/* ArkaFid Facturation — thème */
:root {
  --bg: #f3f5f7; --panel: #ffffff; --panel-2: #f9fafb; --line: #e4e8ec; --line-2: #eef1f4;
  --text: #16202b; --text-2: #3d4a57; --muted: #6b7785; --faint: #9aa5b1;
  --brand: #2f7f8c; --brand-2: #4498a5; --brand-3: #3bbfc9; --brand-soft: #e7f3f5; --brand-ink: #1d5b65;
  --side: #0b1824; --side-2: #12222f; --side-text: #a3b3c2;
  --green: #16803c; --green-soft: #e6f5ec; --red: #c42b31; --red-soft: #fdecec; --amber: #b25a07; --amber-soft: #fdf2e3;
  --blue: #1e63c4; --blue-soft: #e8f0fc; --violet: #6a3fc0; --violet-soft: #f1ebfc; --grey-soft: #eef1f4;
  --r-sm: 7px; --r: 10px; --r-lg: 14px;
  --sh-1: 0 1px 2px rgba(16,24,40,.05); --sh-2: 0 1px 3px rgba(16,24,40,.07), 0 1px 2px rgba(16,24,40,.04);
  --sh-pop: 0 12px 32px rgba(16,24,40,.16), 0 2px 6px rgba(16,24,40,.06);
  --top-h: 60px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Arial, sans-serif; font-size: 14px; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
svg.ic { width: 17px; height: 17px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
::selection { background: rgba(68,152,165,.25); }
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-thumb { background: #cfd6dd; border-radius: 8px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #b5bfc9; background-clip: content-box; border: 3px solid transparent; }

/* ================= structure ================= */
.app { display: grid; grid-template-columns: 244px 1fr; height: 100vh; }
.side { background: var(--side); color: var(--side-text); display: flex; flex-direction: column; overflow-y: auto; border-right: 1px solid #081119; }
.brand { display: flex; align-items: center; padding: 18px 20px 16px; border-bottom: 1px solid rgba(255,255,255,.06); }
.brand img { height: 34px; display: block; }
.nav { padding: 10px 12px; display: flex; flex-direction: column; gap: 1px; }
.nav-sec { font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; color: #5d7385; padding: 16px 10px 6px; font-weight: 600; }
.nav a { position: relative; display: flex; align-items: center; gap: 11px; padding: 8.5px 11px; border-radius: 8px; color: var(--side-text); font-size: 13.8px; font-weight: 500; text-decoration: none; transition: background .12s, color .12s; }
.nav a:hover { background: rgba(255,255,255,.05); color: #e8eef3; }
.nav a.active { background: linear-gradient(90deg, rgba(68,152,165,.28), rgba(68,152,165,.12)); color: #fff; }
.nav a.active::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--brand-3); }
.nav a.active svg.ic { color: var(--brand-3); }
.nav a .cnt { margin-left: auto; font-size: 11px; font-weight: 700; background: var(--red); color: #fff; border-radius: 10px; padding: 1px 7px; min-width: 20px; text-align: center; }
.side-foot { margin-top: auto; padding: 14px 16px 16px; border-top: 1px solid rgba(255,255,255,.06); }
.company-chip { display: flex; gap: 10px; align-items: center; padding: 8px; border-radius: 10px; background: var(--side-2); cursor: pointer; text-decoration: none !important; }
.company-chip:hover { background: #172b3a; }
.company-chip .av { width: 34px; height: 34px; border-radius: 50%; background: #040c14 url(../img/favicon.svg) center/cover; flex: none; }
.company-chip b { display: block; color: #fff; font-size: 13px; font-weight: 600; }
.company-chip span { display: block; color: #7d92a4; font-size: 11.5px; }
.savestate { display: flex; align-items: center; gap: 7px; font-size: 11.5px; color: #6f8597; padding: 10px 4px 0; }
.savestate i { width: 7px; height: 7px; border-radius: 50%; background: #34c38f; box-shadow: 0 0 0 3px rgba(52,195,143,.15); flex: none; }
.savestate.err { color: #fca5a5; } .savestate.err i { background: #ef4444; box-shadow: 0 0 0 3px rgba(239,68,68,.2); }

.main-wrap { display: flex; flex-direction: column; min-width: 0; height: 100vh; }
.topbar { height: var(--top-h); flex: none; background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; padding: 0 24px; z-index: 20; }
.crumb { font-size: 13.5px; color: var(--muted); display: flex; align-items: center; gap: 7px; white-space: nowrap; min-width: 0; }
.crumb b { color: var(--text); font-weight: 600; }
.crumb svg.ic { width: 14px; height: 14px; color: var(--faint); }
.search-btn { margin-left: auto; display: flex; align-items: center; gap: 9px; width: 340px; max-width: 34vw; height: 36px; padding: 0 8px 0 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel-2); color: var(--faint); cursor: pointer; font-size: 13.5px; }
.search-btn:hover { border-color: #cdd5dd; background: #fff; }
kbd { margin-left: auto; font-family: inherit; font-size: 11px; color: var(--muted); background: #fff; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: 1px 6px; }
.icon-btn { position: relative; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 9px; border: 1px solid transparent; background: none; cursor: pointer; color: var(--text-2); }
.icon-btn:hover { background: var(--grey-soft); }
.icon-btn .dot { position: absolute; top: 3px; right: 2px; min-width: 17px; height: 17px; border-radius: 9px; background: var(--red); color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; padding: 0 4px; border: 2px solid #fff; }
.main { flex: 1; overflow-y: auto; min-width: 0; }
.main.fixed { overflow: hidden; }

.page-h { display: flex; align-items: flex-end; gap: 12px; padding: 26px 32px 18px; flex-wrap: wrap; }
.page-h h1 { font-size: 23px; margin: 0; font-weight: 700; letter-spacing: -.02em; }
.page-h .lead { color: var(--muted); font-size: 13.5px; margin-top: 4px; }
.page-h .grow { flex: 1; }
.page-h .acts { display: flex; gap: 8px; flex-wrap: wrap; }
.content { padding: 0 32px 48px; }

/* ================= composants ================= */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; border: 1px solid #d9dfe5; background: #fff; border-radius: 9px; padding: 0 14px; cursor: pointer; font-size: 13.5px; font-weight: 600; white-space: nowrap; box-shadow: var(--sh-1); color: var(--text-2); transition: background .12s, border-color .12s, box-shadow .12s; text-decoration: none !important; }
.btn:hover { border-color: #c4ccd5; background: #fafbfc; color: var(--text); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(68,152,165,.3); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 1px 2px rgba(29,91,101,.3), inset 0 1px 0 rgba(255,255,255,.12); }
.btn.primary:hover { background: var(--brand-ink); border-color: var(--brand-ink); }
.btn.success { background: var(--green); border-color: var(--green); color: #fff; }
.btn.success:hover { background: #106631; }
.btn.danger { color: var(--red); }
.btn.danger:hover { background: var(--red-soft); border-color: #f3c2c4; }
.btn.ghost { box-shadow: none; border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--grey-soft); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12.8px; border-radius: 8px; gap: 6px; }
.btn.sm svg.ic { width: 15px; height: 15px; }
.btn.icon { width: 36px; padding: 0; } .btn.sm.icon { width: 30px; }
.btn:disabled { opacity: .55; cursor: default; }
.btn.busy { pointer-events: none; opacity: .85; }
.btn.busy svg.ic { display: none; }
.btn.busy::before { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-2); margin-bottom: 18px; }
.card-h { display: flex; align-items: center; gap: 10px; padding: 14px 20px; border-bottom: 1px solid var(--line-2); min-height: 58px; }
.card-h h3 { margin: 0; font-size: 14.5px; font-weight: 650; display: flex; align-items: center; gap: 10px; }
.card-h h3 .ico { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.card-h h3 .ico svg.ic { width: 16px; height: 16px; }
.card-h .sub { color: var(--muted); font-size: 12.5px; font-weight: 400; }
.card-h .grow { flex: 1; }
.card-b { padding: 18px 20px; }
.card-b.flush { padding: 0; }
.card-f { padding: 12px 20px; border-top: 1px solid var(--line-2); background: var(--panel-2); border-radius: 0 0 var(--r-lg) var(--r-lg); display: flex; gap: 8px; align-items: center; }

.grid { display: grid; gap: 14px 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0,1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0,1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.span2 { grid-column: span 2; } .span3 { grid-column: span 3; } .span4 { grid-column: 1 / -1; }
label.f { display: flex; flex-direction: column; gap: 6px; font-size: 12.8px; color: var(--text-2); font-weight: 600; }
input.i, select.i, textarea.i { border: 1px solid #d5dce3; border-radius: 8px; height: 38px; padding: 0 11px; background: #fff; color: var(--text); font-size: 13.8px; font-weight: 400; width: 100%; outline: none; transition: border-color .12s, box-shadow .12s; }
select.i { padding-right: 30px; appearance: none; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7785' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 9px center / 15px; }
textarea.i { height: auto; padding: 9px 11px; resize: vertical; min-height: 64px; line-height: 1.5; }
input.i:hover, select.i:hover, textarea.i:hover { border-color: #c1cad3; }
input.i:focus, select.i:focus, textarea.i:focus { border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(68,152,165,.18); }
input.i::placeholder, textarea.i::placeholder { color: #a4aeb8; }
input[type=color].i { padding: 3px; width: 60px; }
.hint { font-size: 12px; color: var(--muted); font-weight: 400; line-height: 1.45; }
.hint.ok { color: var(--green); } .hint.bad { color: var(--red); }
.check { display: flex; align-items: center; gap: 10px; font-size: 13.8px; cursor: pointer; font-weight: 500; }
.check input { width: 17px; height: 17px; accent-color: var(--brand); }
.switch { position: relative; display: flex; align-items: center; gap: 12px; cursor: pointer; font-weight: 500; font-size: 13.8px; color: var(--text); }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track { width: 38px; height: 22px; border-radius: 11px; background: #cfd6dd; position: relative; transition: background .15s; flex: none; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .15s; }
.switch input:checked + .track { background: var(--brand); }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch small { display: block; color: var(--muted); font-weight: 400; font-size: 12.3px; }

.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 3px 10px 3px 8px; border-radius: 20px; white-space: nowrap; line-height: 1.35; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.plain::before { display: none; } .badge.plain { padding: 3px 9px; }
.badge.grey { background: var(--grey-soft); color: #56626e; } .badge.blue { background: var(--blue-soft); color: var(--blue); }
.badge.green { background: var(--green-soft); color: var(--green); } .badge.red { background: var(--red-soft); color: var(--red); }
.badge.amber { background: var(--amber-soft); color: var(--amber); } .badge.violet { background: var(--violet-soft); color: var(--violet); }
.badge.teal { background: var(--brand-soft); color: var(--brand-ink); }

.avatar { width: 34px; height: 34px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 12px; font-weight: 700; color: #fff; flex: none; letter-spacing: .02em; }
.avatar.lg { width: 44px; height: 44px; font-size: 15px; }
.who { display: flex; align-items: center; gap: 11px; min-width: 0; }
.who > div { min-width: 0; }
.who b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who span { display: block; font-size: 12.3px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* tableaux */
.table-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-2); overflow: hidden; }
table.t { width: 100%; border-collapse: collapse; }
table.t th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 650; padding: 11px 16px; background: var(--panel-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t td { padding: 11px 16px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
table.t tbody tr:last-child td { border-bottom: 0; }
table.t tbody tr.click { cursor: pointer; }
table.t tbody tr.click:hover td { background: #f5f9fa; }
table.t tbody tr.click:hover .go { opacity: 1; transform: none; }
table.t .go { opacity: 0; color: var(--faint); transform: translateX(-4px); transition: all .15s; width: 30px; }
table.t tfoot td { background: var(--panel-2); font-weight: 650; border-top: 1px solid var(--line); padding: 12px 16px; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.docno { font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.muted { color: var(--muted); } .small { font-size: 12.5px; } .strong { font-weight: 650; }
.pos { color: var(--green); } .neg { color: var(--red); }
.empty { text-align: center; padding: 56px 20px; color: var(--muted); }
.empty .ill { width: 58px; height: 58px; border-radius: 16px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; margin: 0 auto 14px; }
.empty .ill svg.ic { width: 26px; height: 26px; }
.empty b { display: block; color: var(--text); font-size: 15.5px; margin-bottom: 5px; }
.empty .btn { margin-top: 16px; }

.toolbar { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; align-items: center; }
.search { position: relative; }
.search svg.ic { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--faint); }
.search input.i { padding-left: 35px; width: 290px; }
.tabs { display: inline-flex; background: #e7ebef; border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.tabs button { border: 0; background: none; padding: 6px 12px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--text-2); cursor: pointer; display: inline-flex; gap: 7px; align-items: center; }
.tabs button:hover { color: var(--text); }
.tabs button.on { background: #fff; color: var(--text); box-shadow: 0 1px 2px rgba(16,24,40,.1); }
.tabs button .n { font-size: 11px; color: var(--muted); background: rgba(0,0,0,.06); border-radius: 8px; padding: 0 6px; }
.tabs button.on .n { background: var(--brand-soft); color: var(--brand-ink); }

/* ================= tableau de bord ================= */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 16px; margin-bottom: 18px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px 18px 16px; box-shadow: var(--sh-2); }
.kpi .top { display: flex; align-items: center; justify-content: space-between; }
.kpi .l { font-size: 13px; color: var(--muted); font-weight: 600; }
.kpi .ico { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; }
.kpi .v { font-size: 25px; font-weight: 700; margin-top: 10px; font-variant-numeric: tabular-nums; letter-spacing: -.02em; white-space: nowrap; }
.kpi .v small { font-size: 13px; color: var(--muted); font-weight: 600; margin-right: 5px; letter-spacing: 0; }
.kpi .s { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.kpi .bar { height: 5px; background: var(--grey-soft); border-radius: 3px; margin-top: 10px; overflow: hidden; }
.kpi .bar i { display: block; height: 100%; background: var(--green); border-radius: 3px; }
.dash { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 18px; }
.quick { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; margin-bottom: 18px; }
.quick a { display: flex; align-items: center; gap: 12px; padding: 13px 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; color: var(--text); font-weight: 600; box-shadow: var(--sh-1); text-decoration: none; transition: all .12s; }
.quick a:hover { border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(68,152,165,.12); transform: translateY(-1px); }
.quick a .ico { width: 38px; height: 38px; border-radius: 10px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; flex: none; }
.quick a small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; }
.chart { width: 100%; height: 250px; display: block; }
.chart text { font-size: 11px; fill: var(--muted); font-family: inherit; }
.chart g.m:hover rect.bar { opacity: .8; }
.legend { display: flex; gap: 16px; font-size: 12.5px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.list .it { display: flex; align-items: center; gap: 12px; padding: 11px 20px; border-bottom: 1px solid var(--line-2); cursor: pointer; }
.list .it:hover { background: #f5f9fa; }
.list .it:last-child { border-bottom: 0; }
.list .it .grow { flex: 1; min-width: 0; }
.list .none { padding: 28px 20px; text-align: center; color: var(--muted); font-size: 13px; }
.setup { background: linear-gradient(120deg, #0f2432, #1d4a56); color: #cfe0e7; border-radius: var(--r-lg); padding: 18px 22px; margin-bottom: 18px; display: flex; gap: 16px; align-items: center; }
.setup b { color: #fff; font-size: 15px; display: block; }

/* ================= éditeur ================= */
.editor { display: grid; grid-template-columns: minmax(0, 1fr) clamp(340px, 38%, 720px); height: 100%; }
.editor.nopv { grid-template-columns: minmax(0, 1fr); } .editor.nopv .ed-preview { display: none; }
.editor.nopv .ed-body, .editor.nopv .ed-head > * { max-width: 1100px; }
@media (max-width: 1150px) { .editor { grid-template-columns: 1fr; } .ed-preview { display: none !important; } }
.ed-form { overflow-y: auto; padding-bottom: 60px; }
.ed-head { position: sticky; top: 0; z-index: 6; background: rgba(243,245,247,.96); backdrop-filter: blur(8px); padding: 16px 28px 14px; border-bottom: 1px solid var(--line); }
.ed-head .row1 { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ed-head h1 { font-size: 20px; margin: 0; font-weight: 700; letter-spacing: -.02em; }
.ed-head .meta { color: var(--muted); font-size: 12.8px; margin-top: 2px; }
.ed-head .actions { display: flex; gap: 8px; margin-left: auto; flex-wrap: wrap; }
.steps { display: flex; align-items: center; margin-top: 14px; }
.steps .st { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; color: var(--faint); white-space: nowrap; }
.steps .st i { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; border: 2px solid #d3dae1; background: #fff; font-style: normal; font-size: 11px; }
.steps .st i svg.ic { width: 12px; height: 12px; stroke-width: 3; }
.steps .st.done { color: var(--brand-ink); } .steps .st.done i { background: var(--brand); border-color: var(--brand); color: #fff; }
.steps .st.cur { color: var(--text); } .steps .st.cur i { border-color: var(--brand); color: var(--brand); box-shadow: 0 0 0 3px rgba(68,152,165,.18); }
.steps .st.bad { color: var(--red); } .steps .st.bad i { border-color: var(--red); color: var(--red); background: var(--red-soft); }
.steps .ln { flex: 1; height: 2px; background: #dde3e8; margin: 0 10px; min-width: 20px; max-width: 80px; }
.steps .ln.done { background: var(--brand); }
.ed-body { padding: 20px 28px; }
.ed-preview { background: #d5dbe1; border-left: 1px solid var(--line); overflow: hidden; display: flex; flex-direction: column; }
.pv-bar { display: flex; align-items: center; gap: 6px; padding: 0 12px; height: 46px; background: #fff; border-bottom: 1px solid var(--line); font-size: 12.8px; color: var(--muted); flex: none; }
.pv-bar .grow { flex: 1; }
.pv-bar .z { min-width: 44px; text-align: center; font-variant-numeric: tabular-nums; }
.pv-scroll { flex: 1; overflow: auto; position: relative; }
.pv-scroll .pv-inner { position: relative; margin: 0 auto; }
.pv-scroll iframe { border: 0; width: 210mm; transform-origin: 0 0; position: absolute; left: 0; top: 0; }
.lines-ed { width: 100%; border-collapse: collapse; }
.lines-ed th { font-size: 11px; text-transform: uppercase; color: var(--muted); font-weight: 650; text-align: left; padding: 0 5px 8px; letter-spacing: .05em; }
.lines-ed td { padding: 4px 5px; vertical-align: top; }
.lines-ed tr.ln td { border-top: 1px solid var(--line-2); padding-top: 9px; padding-bottom: 7px; }
.lines-ed input.i, .lines-ed textarea.i { height: 34px; padding: 0 8px; font-size: 13.3px; }
.lines-ed textarea.i { min-height: 34px; padding: 7px 8px; resize: none; overflow: hidden; line-height: 1.4; }
.lines-ed td:first-child { min-width: 190px; }
.lines-ed .w-qty { width: 62px; } .lines-ed .w-unit { width: 72px; } .lines-ed .w-price { width: 92px; } .lines-ed .w-disc { width: 56px; } .lines-ed .w-vat { width: 60px; }
.lines-ed .w-tot { width: 92px; padding-top: 17px !important; font-weight: 600; }
.lines-ed .ops { width: 72px; white-space: nowrap; text-align: right; }
.lines-ed .ops button { border: 0; background: none; cursor: pointer; color: var(--faint); padding: 5px 3px; border-radius: 6px; display: inline-grid; place-items: center; }
.lines-ed .ops button svg.ic { width: 15px; height: 15px; }
.lines-ed .ops button:hover { color: var(--text); background: var(--grey-soft); }
.lines-ed .ops button.del:hover { color: var(--red); background: var(--red-soft); }
.lines-ed tr.txt textarea.i { font-style: italic; background: var(--panel-2); }
.lines-ed tr.sect textarea.i { font-weight: 650; background: var(--brand-soft); border-color: #cfe5e9; }
.lines-add { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; align-items: center; }
.lines-add select.i { width: auto; max-width: 320px; height: 30px; font-size: 12.8px; }
.sum-box { margin-left: auto; width: 320px; font-size: 13.8px; }
.sum-box .r { display: flex; justify-content: space-between; padding: 5px 0; color: var(--text-2); }
.sum-box .r.m { color: var(--muted); font-size: 13px; }
.sum-box .r.g { font-weight: 700; font-size: 17px; border-top: 1px solid var(--line); margin-top: 8px; padding-top: 11px; color: var(--text); }
.notice { display: flex; gap: 10px; align-items: flex-start; background: var(--blue-soft); color: #1d3f6e; border-radius: 10px; padding: 11px 14px; font-size: 13.3px; margin-bottom: 16px; line-height: 1.45; border: 1px solid #d3e2f8; }
.notice svg.ic { margin-top: 1px; }
.notice .grow { flex: 1; }
.notice.warn { background: var(--amber-soft); color: #7a3e06; border-color: #f5dcb8; }
.notice.bad { background: var(--red-soft); color: #7f1d1d; border-color: #f6c9cb; }
.notice.ok { background: var(--green-soft); color: #14532d; border-color: #c6e8d3; }
.timeline .ev { display: flex; gap: 12px; padding: 9px 0; position: relative; }
.timeline .ev::before { content: ""; position: absolute; left: 13px; top: 38px; bottom: -8px; width: 2px; background: var(--line-2); }
.timeline .ev:last-child::before { display: none; }
.timeline .ev .dot { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--grey-soft); color: var(--muted); }
.timeline .ev .dot svg.ic { width: 14px; height: 14px; }
.timeline .ev .dot.green { background: var(--green-soft); color: var(--green); } .timeline .ev .dot.blue { background: var(--blue-soft); color: var(--blue); }
.timeline .ev .dot.amber { background: var(--amber-soft); color: var(--amber); } .timeline .ev .dot.teal { background: var(--brand-soft); color: var(--brand); }
.timeline .ev .grow { flex: 1; min-width: 0; font-size: 13.3px; padding-top: 4px; }
.balance { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line-2); border-radius: 10px; overflow: hidden; border: 1px solid var(--line-2); margin-bottom: 14px; }
.balance div { background: #fff; padding: 11px 14px; }
.balance .k { font-size: 11px; color: var(--muted); font-weight: 650; text-transform: uppercase; letter-spacing: .05em; }
.balance .v { font-size: 16px; font-weight: 700; margin-top: 3px; font-variant-numeric: tabular-nums; }

/* menus */
.menu-wrap { position: relative; }
.menu { position: absolute; right: 0; top: calc(100% + 6px); background: #fff; border: 1px solid var(--line); border-radius: 11px; box-shadow: var(--sh-pop); padding: 6px; min-width: 250px; z-index: 60; display: none; }
.menu.open { display: block; animation: pop .12s ease; }
.menu button, .menu a { display: flex; width: 100%; align-items: center; text-align: left; border: 0; background: none; padding: 8px 10px; border-radius: 7px; cursor: pointer; font-size: 13.5px; gap: 10px; color: var(--text-2); text-decoration: none !important; }
.menu button:hover, .menu a:hover { background: var(--grey-soft); color: var(--text); }
.menu button.danger { color: var(--red); } .menu button.danger:hover { background: var(--red-soft); }
.menu hr { border: 0; border-top: 1px solid var(--line-2); margin: 5px 0; }
.menu .mh { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); padding: 6px 10px 4px; font-weight: 650; }
.menu .it-2 { display: block; } .menu .it-2 small { display: block; color: var(--muted); font-size: 12px; }
@keyframes pop { from { opacity: 0; transform: translateY(-4px); } }

/* modales */
.modal-bg { position: fixed; inset: 0; background: rgba(11,24,36,.5); display: grid; place-items: center; z-index: 100; padding: 20px; animation: fade .15s ease; }
@keyframes fade { from { opacity: 0; } }
.modal { background: #fff; border-radius: 16px; width: 580px; max-width: 100%; max-height: calc(100vh - 40px); display: flex; flex-direction: column; box-shadow: 0 30px 70px rgba(0,0,0,.28); animation: rise .18s ease; }
@keyframes rise { from { transform: translateY(10px) scale(.99); opacity: .5; } }
.modal.wide { width: 900px; }
.modal-h { padding: 16px 22px; border-bottom: 1px solid var(--line-2); display: flex; align-items: center; gap: 12px; }
.modal-h h2 { margin: 0; font-size: 17px; flex: 1; font-weight: 700; letter-spacing: -.01em; }
.modal-h .ico { width: 36px; height: 36px; border-radius: 10px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; }
.modal-b { padding: 20px 22px; overflow-y: auto; }
.modal-f { padding: 14px 22px; border-top: 1px solid var(--line-2); display: flex; gap: 8px; justify-content: flex-end; align-items: center; background: var(--panel-2); border-radius: 0 0 16px 16px; }

.attach { display: flex; flex-wrap: wrap; gap: 8px; }
.attach .file { display: flex; align-items: center; gap: 10px; padding: 7px 14px 7px 7px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2); font-size: 13px; }
.attach .file .pdf { width: 32px; height: 38px; border-radius: 5px; background: #e5484d; color: #fff; font-size: 9.5px; font-weight: 800; display: grid; place-items: center; letter-spacing: .04em; }
.attach .file b { display: block; font-weight: 600; }
.attach .file span { display: block; color: var(--muted); font-size: 12px; }

/* palette de recherche */
.palette-bg { position: fixed; inset: 0; background: rgba(11,24,36,.45); z-index: 120; display: flex; justify-content: center; align-items: flex-start; padding-top: 11vh; animation: fade .12s; }
.palette { width: 660px; max-width: calc(100vw - 32px); background: #fff; border-radius: 16px; box-shadow: 0 30px 70px rgba(0,0,0,.3); overflow: hidden; animation: rise .15s; }
.palette .in { display: flex; align-items: center; gap: 12px; padding: 0 18px; border-bottom: 1px solid var(--line-2); color: var(--faint); }
.palette .in input { flex: 1; border: 0; outline: none; height: 56px; font-size: 16px; color: var(--text); }
.palette .res { max-height: 430px; overflow-y: auto; padding: 6px; }
.palette .grp { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); padding: 10px 12px 4px; font-weight: 650; }
.palette .row { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: 9px; cursor: pointer; }
.palette .row .grow { flex: 1; min-width: 0; }
.palette .row .grow b { display: block; font-weight: 600; font-size: 13.8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.palette .row .grow span { display: block; font-size: 12.3px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.palette .row.sel { background: var(--brand-soft); }
.palette .row .rico { width: 32px; height: 32px; border-radius: 8px; background: var(--grey-soft); color: var(--text-2); display: grid; place-items: center; flex: none; }
.palette .row.sel .rico { background: #fff; color: var(--brand); }
.palette .foot { display: flex; gap: 16px; padding: 10px 18px; border-top: 1px solid var(--line-2); font-size: 12px; color: var(--muted); background: var(--panel-2); }
.palette .foot kbd { margin: 0 4px 0 0; }

.toasts { position: fixed; bottom: 22px; right: 22px; display: flex; flex-direction: column; gap: 10px; z-index: 200; }
.toast { display: flex; align-items: center; gap: 10px; background: #13212e; color: #fff; padding: 12px 16px; border-radius: 11px; font-size: 13.5px; box-shadow: 0 12px 30px rgba(0,0,0,.25); max-width: 460px; animation: tin .2s ease; line-height: 1.4; }
.toast svg.ic { color: #7fd3dc; }
.toast.err { background: #8f1d22; } .toast.err svg.ic { color: #ffc9cb; }
.toast.ok svg.ic { color: #6ee7a0; }
@keyframes tin { from { transform: translateY(10px); opacity: 0; } }

/* paramètres */
.settings { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px; align-items: start; max-width: 1100px; }
.snav { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 2px; }
.snav button { display: flex; align-items: center; gap: 10px; border: 0; background: none; padding: 9px 12px; border-radius: 9px; font-size: 13.8px; font-weight: 600; color: var(--text-2); cursor: pointer; text-align: left; }
.snav button:hover { background: #e7ebef; }
.snav button.on { background: #fff; color: var(--brand-ink); box-shadow: var(--sh-2); }
.snav button.on svg.ic { color: var(--brand); }
.qr-preview { background: #d5dbe1; border-radius: var(--r-lg); overflow: hidden; position: relative; border: 1px solid var(--line); }
.qr-preview iframe { border: 0; width: 210mm; height: 297mm; transform-origin: 0 0; position: absolute; }
.logo-prev { width: 220px; height: 80px; border: 1px dashed #cfd6df; border-radius: 10px; display: grid; place-items: center; background: #fff; overflow: hidden; padding: 8px; }
.logo-prev img { max-width: 100%; max-height: 100%; }
.drop { border: 2px dashed #c9d2dd; border-radius: var(--r-lg); padding: 42px 30px; text-align: center; color: var(--muted); background: #fff; cursor: pointer; transition: all .12s; }
.drop:hover, .drop.over { border-color: var(--brand-2); background: var(--brand-soft); color: var(--brand-ink); }
.drop .ill { width: 52px; height: 52px; border-radius: 14px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; margin: 0 auto 12px; }
.drop .ill svg.ic { width: 24px; height: 24px; }
code { background: var(--grey-soft); padding: 1px 6px; border-radius: 5px; font-size: 12.5px; }

@media (max-width: 1000px) {
  .app { grid-template-columns: 72px 1fr; }
  .brand img, .nav-sec, .company-chip div, .savestate span { display: none; }
  .brand { justify-content: center; padding: 14px 0; }
  .brand::after { content: ""; width: 40px; height: 40px; background: url(../img/favicon.svg) center/contain no-repeat; }
  .nav a { justify-content: center; font-size: 0; gap: 0; } .nav a .cnt { position: absolute; top: 2px; right: 4px; font-size: 10px; }
  .kpis, .quick { grid-template-columns: repeat(2, minmax(0,1fr)); } .dash { grid-template-columns: 1fr; }
  .search-btn { width: 40px; padding: 0 10px; } .search-btn span, .search-btn kbd { display: none; }
  .settings { grid-template-columns: 1fr; } .snav { position: static; flex-direction: row; flex-wrap: wrap; }
}

/* ================= authentification ================= */
.au { position: fixed; inset: 0; z-index: 500; display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(460px, 1fr); background: #f4f6f8; animation: fade .25s; overflow: hidden; }
.au-side { position: relative; overflow: hidden; color: #b7c8d4; padding: 44px 56px 36px; display: flex; flex-direction: column;
  background:
    radial-gradient(60% 55% at 12% 8%, rgba(59,191,201,.28) 0%, transparent 60%),
    radial-gradient(55% 50% at 95% 100%, rgba(47,127,140,.35) 0%, transparent 65%),
    linear-gradient(160deg, #0d2330 0%, #081520 55%, #06101a 100%); }
.au-side::before { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(255,255,255,.07) 1px, transparent 1px); background-size: 22px 22px; mask-image: linear-gradient(180deg, rgba(0,0,0,.9), transparent 85%); pointer-events: none; }
.au-side > * { position: relative; }
.au-logo { height: 46px; align-self: flex-start; }
.au-hero { margin: auto 0; max-width: 540px; }
.au-kicker { display: inline-block; font-size: 11.5px; letter-spacing: .16em; text-transform: uppercase; color: #7fd3dc; font-weight: 700; padding: 5px 11px; border: 1px solid rgba(127,211,220,.3); border-radius: 20px; background: rgba(59,191,201,.08); }
.au-hero h2 { color: #fff; font-size: clamp(30px, 3.2vw, 42px); line-height: 1.12; letter-spacing: -.025em; margin: 18px 0 14px; font-weight: 750; }
.au-hero h2 em { font-style: normal; background: linear-gradient(90deg, #7fe3ea, #3bbfc9); -webkit-background-clip: text; background-clip: text; color: transparent; }
.au-hero p { font-size: 15.5px; line-height: 1.6; margin: 0; color: #a9bccb; max-width: 470px; }
.au-demo { position: relative; margin: 34px 0 6px; height: 232px; }
.au-demo-card { position: absolute; left: 0; top: 0; width: 330px; padding: 18px 20px; border-radius: 16px; background: rgba(255,255,255,.96); color: #16202b; box-shadow: 0 30px 60px rgba(0,0,0,.35), 0 0 0 1px rgba(255,255,255,.4); transform: rotate(-2.5deg); }
.au-demo-top { display: flex; justify-content: space-between; align-items: center; font-size: 12px; }
.au-demo-no { color: #6b7785; font-weight: 600; }
.au-pill { display: inline-flex; align-items: center; gap: 4px; background: #e6f5ec; color: #16803c; font-weight: 700; font-size: 11.5px; padding: 3px 9px 3px 6px; border-radius: 20px; }
.au-pill svg.ic { width: 12px; height: 12px; stroke-width: 3; }
.au-demo-amt { font-size: 28px; font-weight: 800; letter-spacing: -.02em; margin: 8px 0 10px; font-variant-numeric: tabular-nums; }
.au-demo-amt small { font-size: 13px; color: #6b7785; margin-right: 6px; font-weight: 700; }
.au-demo-rows i { display: block; height: 7px; border-radius: 4px; background: #eef1f4; margin: 6px 0; }
.au-demo-qr { display: flex; gap: 10px; align-items: center; margin-top: 12px; padding-top: 12px; border-top: 1px dashed #cfd6dd; font-size: 11.5px; color: #6b7785; line-height: 1.35; }
.au-demo-qr svg.ic { width: 34px; height: 34px; color: #16202b; stroke-width: 1.6; }
.au-demo-qr b { color: #16202b; font-weight: 650; }
.au-demo-chip { position: absolute; display: flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 12px; font-size: 13px; font-weight: 600; color: #e7f3f5; background: rgba(15,40,52,.85); border: 1px solid rgba(127,211,220,.25); box-shadow: 0 14px 30px rgba(0,0,0,.3); backdrop-filter: blur(6px); }
.au-demo-chip svg.ic { color: #7fd3dc; width: 16px; height: 16px; }
.au-demo-chip.c1 { left: 300px; top: 22px; animation: float 6s ease-in-out infinite; }
.au-demo-chip.c2 { left: 250px; top: 120px; animation: float 6s ease-in-out -3s infinite; }
@keyframes float { 50% { transform: translateY(-6px); } }
.au-feats { list-style: none; padding: 0; margin: 28px 0 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.au-feats li { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border-radius: 12px; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.07); font-size: 12.5px; color: #93a9b9; line-height: 1.35; }
.au-feats li svg.ic { color: #7fd3dc; width: 18px; height: 18px; margin-top: 1px; }
.au-feats b { display: block; color: #e8f1f5; font-size: 13px; font-weight: 650; }
.au-foot { font-size: 12px; color: #5b7384; margin-top: 28px; }

.au-main { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 32px; overflow-y: auto; }
.au-card { width: 420px; max-width: 100%; }
.au-mark { width: 52px; height: 52px; border-radius: 14px; background: #06101a url(../img/favicon.svg) center/cover; box-shadow: 0 10px 24px rgba(11,24,36,.18); margin-bottom: 22px; }
.au-card h1 { margin: 0 0 8px; font-size: 28px; letter-spacing: -.025em; font-weight: 750; }
.au-lead { color: var(--muted); margin: 0 0 26px; line-height: 1.55; font-size: 14.5px; }
.au-card form { display: grid; gap: 16px; }
.au-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.au-f { display: flex; flex-direction: column; gap: 7px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.au-in { position: relative; }
.au-in > svg.ic { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--faint); width: 17px; height: 17px; pointer-events: none; transition: color .12s; }
.au-in input.i { height: 46px; padding-left: 40px; font-size: 14.5px; border-radius: 10px; background: #fff; }
.au-in:focus-within > svg.ic { color: var(--brand); }
.au-in.pw input.i { padding-right: 44px; }
.pw-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border: 0; background: none; cursor: pointer; color: var(--faint); border-radius: 8px; display: grid; place-items: center; }
.pw-eye:hover, .pw-eye.on { color: var(--brand); background: var(--brand-soft); }
.au-caps { display: flex; align-items: center; gap: 6px; font-style: normal; font-size: 12.3px; color: var(--amber); font-weight: 600; }
.au-caps svg.ic { width: 14px; height: 14px; }
.au-caps[hidden] { display: none; }
.au-strength { display: grid; grid-template-columns: repeat(4, 1fr) auto; gap: 5px; align-items: center; margin-top: -8px; }
.au-strength i { height: 4px; border-radius: 3px; background: var(--line); transition: background .2s; }
.au-strength span { font-size: 11.8px; color: var(--muted); margin-left: 6px; white-space: nowrap; }
.au-strength[data-s="1"] i:nth-child(-n+1) { background: var(--red); }
.au-strength[data-s="2"] i:nth-child(-n+2) { background: var(--amber); }
.au-strength[data-s="3"] i:nth-child(-n+3) { background: var(--brand-2); }
.au-strength[data-s="4"] i:nth-child(-n+4) { background: var(--green); }
.au-line { display: flex; justify-content: space-between; align-items: center; font-size: 13.5px; }
.au-link { font-weight: 600; font-size: 13.5px; }
.au-btn { height: 48px; font-size: 15px; border-radius: 11px; margin-top: 4px; gap: 10px; }
.au-btn svg.ic { transition: transform .15s; }
.au-btn:hover svg.ic { transform: translateX(3px); }
.au-msg { margin: 0; }
.au-msg[hidden] { display: none !important; }
.au-note { margin: -8px 0 20px; }
.au-small { font-size: 12.5px; color: var(--muted); margin: 0; text-align: center; line-height: 1.5; }
.au-back { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; color: var(--muted); font-weight: 600; font-size: 13px; cursor: pointer; padding: 6px 8px 6px 4px; margin: -6px 0 12px -4px; border-radius: 8px; }
.au-back:hover { color: var(--text); background: var(--grey-soft); }
.au-back svg.ic { width: 15px; height: 15px; }
.au-help { margin-top: 34px; font-size: 12.8px; color: var(--muted); display: flex; align-items: center; gap: 7px; }
.au-help svg.ic { width: 15px; height: 15px; }
@media (max-width: 1100px) { .au-demo { display: none; } .au-feats { grid-template-columns: 1fr; } }
@media (max-width: 880px) { .au { grid-template-columns: 1fr; } .au-side { display: none; } .au-mark { margin-inline: 0; } }

/* sélecteur de société & menu utilisateur */
.company-chip { width: 100%; border: 0; text-align: left; font: inherit; }
.company-chip .avatar { width: 34px; height: 34px; }
.company-chip .chev { margin-left: auto; color: #6f8597; }
.side-foot .menu { top: auto; bottom: calc(100% + 6px); left: 0; right: 0; min-width: 0; }
.menu .co { display: flex; align-items: center; gap: 10px; }
.menu .co .avatar { width: 26px; height: 26px; font-size: 10px; }
.menu .co.cur { background: var(--brand-soft); color: var(--brand-ink); }
.user-btn { display: flex; align-items: center; gap: 9px; border: 1px solid transparent; background: none; border-radius: 10px; padding: 3px 8px 3px 3px; cursor: pointer; }
.user-btn:hover { background: var(--grey-soft); }
.user-btn .avatar { width: 32px; height: 32px; }
.user-btn .un { text-align: left; line-height: 1.2; }
.user-btn .un b { display: block; font-size: 13px; }
.user-btn .un span { font-size: 11.5px; color: var(--muted); }
.menu .me { padding: 10px 10px 8px; }
.menu .me b { display: block; } .menu .me span { font-size: 12.3px; color: var(--muted); }
.role-admin { background: #10222f; color: #7fd3dc; }
.cred { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; font-size: 13.5px; line-height: 1.9; }
.cred code { font-size: 13.5px; background: #fff; border: 1px solid var(--line); }
.checklist { display: grid; gap: 6px; max-height: 220px; overflow-y: auto; border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; }
.notice[hidden] { display: none !important; }
.asbar { display: flex; align-items: center; gap: 10px; padding: 8px 24px; background: #10222f; color: #cfe0e7; font-size: 13px; border-bottom: 1px solid #081119; flex: none; }
.asbar > svg.ic { color: #7fd3dc; }
.asbar span { flex: 1; } .asbar b { color: #fff; }
.asbar .btn { background: transparent; color: #e7f3f5; border-color: rgba(255,255,255,.2); box-shadow: none; }
.asbar .btn:hover { background: rgba(255,255,255,.08); color: #fff; }
.au-sep { display: flex; align-items: center; gap: 12px; margin: 24px 0 14px; color: var(--muted); font-size: 12.8px; }
.au-sep::before, .au-sep::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.au-btn2 { width: 100%; height: 46px; border-radius: 11px; font-size: 14.2px; }
.au-install { margin-top: 12px; width: 100%; border: 1px dashed #c9d2dd; background: transparent; border-radius: 11px; height: 42px; color: var(--brand-ink); font: inherit; font-weight: 600; font-size: 13.5px; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; }
.au-install:hover { background: var(--brand-soft); border-color: var(--brand-2); }
.au-install[hidden] { display: none; }
input.i.au-plain, textarea.i.au-plain { height: 46px; border-radius: 10px; font-size: 14.5px; }
textarea.i.au-plain { height: auto; padding: 10px 12px; }
.au-done { width: 64px; height: 64px; border-radius: 18px; background: var(--green-soft); color: var(--green); display: grid; place-items: center; margin-bottom: 18px; }
.au-done svg.ic { width: 32px; height: 32px; }
.au-card:has(.au-done) .au-mark { display: none; }

/* ================= mobile / application installée ================= */
.tabbar { display: none; }
@media (max-width: 760px) {
  html, body { overscroll-behavior-y: none; }
  .app { grid-template-columns: 1fr; height: 100dvh; }
  .side { position: fixed; z-index: 90; top: 0; bottom: 0; left: 0; width: min(300px, 86vw); transform: translateX(-102%); transition: transform .22s ease; box-shadow: 0 0 40px rgba(0,0,0,.35); padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
  body.nav-open .side { transform: none; }
  body.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(11,24,36,.45); z-index: 80; }
  .brand img, .nav-sec, .company-chip div, .savestate span { display: revert; }
  .brand { justify-content: flex-start; padding: calc(14px + env(safe-area-inset-top)) 20px 14px; } .brand::after { display: none; }
  .nav a { justify-content: flex-start; font-size: 14.5px; gap: 12px; padding: 11px 12px; } .nav a .cnt { position: static; font-size: 11px; }
  .main-wrap { height: 100dvh; }
  .topbar { padding: env(safe-area-inset-top) 12px 0; height: calc(56px + env(safe-area-inset-top)); gap: 6px; }
  .crumb { font-size: 14px; flex: 1; overflow: hidden; } .crumb > :not(:last-child), .crumb svg.ic { display: none; }
  .search-btn { margin-left: 0; width: 38px; padding: 0 10px; background: transparent; border-color: transparent; } .search-btn span, .search-btn kbd { display: none; }
  #new-btn { width: 38px; padding: 0; font-size: 0; gap: 0; } #new-btn svg.ic { width: 19px; height: 19px; }
  .user-btn .un { display: none; } .user-btn { padding: 2px; }
  .menu { position: fixed; left: 10px !important; right: 10px !important; top: calc(60px + env(safe-area-inset-top)); min-width: 0; max-height: 70vh; overflow-y: auto; }
  #bell-menu { width: auto !important; }
  .side-foot .menu { position: absolute; top: auto; }
  .asbar { padding: 8px 12px; font-size: 12px; flex-wrap: wrap; } .asbar span { flex-basis: calc(100% - 30px); }
  .main { padding-bottom: calc(76px + env(safe-area-inset-bottom)); -webkit-overflow-scrolling: touch; }
  .tabbar { display: flex; position: fixed; z-index: 70; left: 0; right: 0; bottom: 0; background: rgba(255,255,255,.97); backdrop-filter: blur(10px); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .tabbar a, .tabbar button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0; border: 0; background: none; color: var(--muted); font: inherit; font-size: 11px; font-weight: 600; text-decoration: none !important; border-radius: 10px; }
  .tabbar svg.ic { width: 22px; height: 22px; }
  .tabbar a.active { color: var(--brand); } .tabbar a.active svg.ic { stroke-width: 2.3; }
  .toasts { left: 12px; right: 12px; bottom: calc(84px + env(safe-area-inset-bottom)); } .toast { max-width: none; }

  .page-h { padding: 18px 16px 12px; align-items: flex-start; } .page-h h1 { font-size: 21px; } .page-h .grow { display: none; }
  .page-h .acts { width: 100%; } .page-h .acts .btn { flex: 1; }
  .content { padding: 0 12px 24px; }
  .grid.g2, .grid.g3, .grid.g4, .g2, .g3, .g4 { grid-template-columns: 1fr; } .span2, .span3, .span4 { grid-column: auto; }
  .kpis { grid-template-columns: 1fr 1fr !important; gap: 10px; } .kpi { padding: 14px; } .kpi .v { font-size: 19px; } .kpi .ico { display: none; }
  .quick { grid-template-columns: 1fr 1fr; gap: 10px; } .quick a { padding: 12px; gap: 10px; font-size: 13px; } .quick a small { display: none; }
  .dash { grid-template-columns: 1fr; gap: 12px; }
  .card { border-radius: 12px; margin-bottom: 12px; } .card-h { padding: 12px 14px; } .card-b { padding: 14px; }
  .setup, .notice { flex-wrap: wrap; }
  .toolbar { gap: 8px; } .search, .search input.i { width: 100%; } .tabs { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; } .tabs button { white-space: nowrap; }
  .table-card { overflow-x: auto; -webkit-overflow-scrolling: touch; } table.t { min-width: 640px; } table.t .go { display: none; }
  .list .it { padding: 11px 14px; } .list .it .btn { display: none; }
  input.i, select.i, textarea.i { font-size: 16px; } /* évite le zoom automatique sur iPhone */

  .editor { grid-template-columns: 1fr; height: auto; min-height: 100%; } .ed-preview { display: none !important; } .ed-form { overflow: visible; }
  .ed-head { position: static; padding: 12px 14px; } .ed-head h1 { font-size: 18px; } .ed-head .actions { width: 100%; margin-left: 0; } .ed-head .actions .btn:not(.icon) { flex: 1; }
  .steps .ln { min-width: 10px; margin: 0 6px; } .steps .st { font-size: 11.5px; gap: 5px; }
  .ed-body { padding: 12px; }
  #lines { display: block; } .lines-ed, .lines-ed tbody, .lines-ed tr, .lines-ed td { display: block; width: auto !important; } .lines-ed thead { display: none; }
  .lines-ed tr.ln { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 10px 0; border-top: 1px solid var(--line-2); }
  .lines-ed tr.ln td { padding: 0 !important; border: 0; }
  .lines-ed tr.ln td:first-child { grid-column: 1 / -1; }
  .lines-ed tr.ln td.w-tot { grid-column: 1 / 3; align-self: center; text-align: left; font-size: 15px; } .lines-ed tr.ln td.ops { grid-column: 3 / 5; text-align: right; }
  .lines-ed tr.txt, .lines-ed tr.sect { grid-template-columns: 1fr auto; } .lines-ed tr.txt td:first-child, .lines-ed tr.sect td:first-child { grid-column: 1; }
  .sum-box { width: 100%; }
  .balance { grid-template-columns: 1fr 1fr; }
  .modal-bg { padding: 0; align-items: end; } .modal, .modal.wide { width: 100%; max-height: 92dvh; border-radius: 16px 16px 0 0; }
  .modal-f { flex-wrap: wrap; border-radius: 0; padding-bottom: calc(14px + env(safe-area-inset-bottom)); } .modal-f > span[style] { display: none; }
  .settings { grid-template-columns: 1fr; gap: 12px; } .snav { position: static; flex-direction: row; overflow-x: auto; } .snav button { white-space: nowrap; }
  .palette-bg { padding-top: calc(10px + env(safe-area-inset-top)); } .palette { max-width: calc(100vw - 20px); }
  .au-main { padding: calc(24px + env(safe-area-inset-top)) 20px 28px; justify-content: flex-start; } .au-row { grid-template-columns: 1fr; }
}
@media (display-mode: standalone) { .au-install { display: none !important; } }
