/* 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; justify-content: center; padding: 16px 14px 14px; border-bottom: 1px solid rgba(255,255,255,.06); }
.brand img { height: 54px; max-width: 100%; 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:not(.avatar) { 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; overflow-x: auto; }
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; }
/* désignation : la plus grande partie de la largeur ; colonnes chiffrées compactes */
.lines-ed td:first-child, .lines-ed th:first-child { width: auto; min-width: 300px; }
.lines-ed td:first-child textarea.i { font-size: 14px; line-height: 1.45; }
.lines-ed .w-qty { width: 54px; } .lines-ed .w-unit { width: 66px; } .lines-ed .w-price { width: 86px; } .lines-ed .w-disc { width: 50px; } .lines-ed .w-vat { width: 50px; }
.lines-ed .w-qty input.i, .lines-ed .w-unit input.i, .lines-ed .w-price input.i, .lines-ed .w-disc input.i, .lines-ed .w-vat input.i { padding: 0 6px; }
.lines-ed .w-tot { width: 88px; padding-top: 17px !important; font-weight: 600; }
.lines-ed .ops { width: 64px; 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; }
/* ordinateur : chaque position sur deux niveaux — la désignation occupe toute la largeur,
   quantité / unité / prix / rabais / TVA / montant en dessous (avec leur intitulé) */
@media (min-width: 761px) {
  .lines-ed, .lines-ed tbody { display: block; width: 100%; } .lines-ed thead { display: none; }
  .lines-ed tr.ln { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0 10px; border-top: 1px solid var(--line-2); padding: 12px 0 10px; }
  .lines-ed tr.ln > td { display: block; border: 0 !important; padding: 0 !important; width: auto; min-width: 0; }
  .lines-ed tr.ln > td:first-child { flex: 1 1 100%; margin-bottom: 8px; }
  .lines-ed tr.txt > td:first-child, .lines-ed tr.sect > td:first-child { flex: 1 1 0; margin-bottom: 0; }
  .lines-ed tr.ln > td[data-label]:not(:first-child):not(.ops)::before { content: attr(data-label); display: block; font-size: 10.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; color: var(--faint); margin-bottom: 4px; }
  .lines-ed tr.ln > td:first-child textarea.i { font-size: 14px; line-height: 1.5; padding: 9px 11px; }
  .lines-ed tr.ln > td.w-qty { width: 80px; } .lines-ed tr.ln > td.w-unit { width: 100px; } .lines-ed tr.ln > td.w-price { width: 120px; } .lines-ed tr.ln > td.w-disc { width: 80px; } .lines-ed tr.ln > td.w-vat { width: 80px; }
  .lines-ed tr.ln > td input.i { width: 100%; }
  .lines-ed tr.ln > td.w-tot { margin-left: auto; text-align: right; font-size: 15px; line-height: 34px; min-width: 110px; }
  .lines-ed tr.ln > td.w-tot::before { line-height: normal; }
  .lines-ed tr.ln > td.ops { width: auto; line-height: 34px; }
}
.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; }
  .table-card { overflow-x: auto; } table.t .go { display: none; }
}

/* ================= 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; display: inline-grid; place-items: center; color: #fff; font-size: 12px; font-weight: 700; }
.company-chip .chev { margin-left: auto; color: #6f8597; }
.co-logo { flex: none; height: 34px; width: 78px; border-radius: 8px; background: #fff; display: grid; place-items: center; padding: 4px 6px; overflow: hidden; }
.company-chip > div { flex: 1; min-width: 0; } .company-chip > div b, .company-chip > div span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.co-logo img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
@media (max-width: 1000px) and (min-width: 761px) { .company-chip { justify-content: center; padding: 6px; } .company-chip .chev { display: none; } .co-logo { width: 46px; height: 32px; padding: 3px; } }
.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: center; padding: calc(14px + env(safe-area-inset-top)) 14px 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; } .main.fixed { overflow-y: auto; overflow-x: hidden; }
  .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; }
  /* tableaux -> fiches empilées */
  .table-card { overflow: hidden; }
  table.t, table.t tbody, table.t tfoot { display: block; width: 100%; min-width: 0; }
  table.t thead { display: none; }
  table.t tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px 14px; padding: 12px 14px; border-bottom: 1px solid var(--line-2); align-items: start; }
  table.t tbody tr:last-child { border-bottom: 0; }
  table.t td { display: block; padding: 0 !important; border: 0 !important; min-width: 0; text-align: left; white-space: normal; overflow-wrap: anywhere; }
  table.t td.num { text-align: left; }
  table.t td[data-label]:not([data-label=""])::before { content: attr(data-label); display: block; font-size: 10.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; color: var(--faint); margin-bottom: 2px; }
  table.t td:empty, table.t .go { display: none; }
  table.t td:has(.who), table.t td[colspan] { grid-column: 1 / -1; text-align: left; }
  table.t td:last-child:has(.btn, button) { grid-column: 1 / -1; text-align: right; }
  table.t tfoot tr { background: var(--panel-2); } table.t tfoot td { background: none; }
  table.t .who span:not(.avatar) { white-space: normal; }
  table.t:not(.docs) tbody td:first-child:has(b, strong, .strong) { grid-column: 1 / -1; }
  table.t.docs tbody tr { grid-template-areas: "a b" "c c" "d e" "t s"; gap: 6px 14px; }
  table.t.docs .c-a { grid-area: a; } table.t.docs .c-b { grid-area: b; text-align: right; } table.t.docs .c-c { grid-area: c; }
  table.t.docs .c-d { grid-area: d; } table.t.docs .c-e { grid-area: e; text-align: right; }
  table.t.docs .c-t { grid-area: t; font-size: 15px; } table.t.docs .c-s { grid-area: s; text-align: right; }
  table.t.docs tfoot td[colspan] { grid-column: 1 / -1; } table.t.docs tfoot td:nth-child(3) { text-align: right; }
  table.t.docs .c-a::before, table.t.docs .c-b::before, table.t.docs .c-c::before { display: none !important; }
  table.t.docs .c-a .docno { font-size: 15px; }
  .ed-form { min-width: 0; }
  .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%; }
  .lines-ed tr.ln td[data-label]:not([data-label=""]):not(:first-child):not(.ops)::before { content: attr(data-label); display: block; font-size: 10.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; color: var(--faint); margin-bottom: 3px; }
  .lines-ed tr.ln td.w-tot { padding-top: 0 !important; }
  #recseg { flex-wrap: wrap; overflow: visible; }
  .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; } }

/* éléments masqués (l’attribut hidden doit primer sur display:flex/grid) */
.f[hidden], .quick-pcts[hidden] { display: none !important; }

/* formulaire d'accès : adresse sur deux lignes lisibles */
.au-row.au-addr1 { grid-template-columns: minmax(0, 1fr) 96px; }
.au-row.au-addr2 { grid-template-columns: 112px minmax(0, 1fr); }
/* champs date : jamais plus larges que leur colonne (iPhone) */
input.i[type="date"], input.i[type="time"] { min-width: 0; max-width: 100%; width: 100%; display: block; -webkit-appearance: none; appearance: none; text-align: left; }
input.i[type="date"]::-webkit-date-and-time-value { text-align: left; }
@media (max-width: 760px) {
  /* 16 px minimum : sinon l'iPhone zoome à chaque saisie et la page reste décalée */
  .au-in input.i, input.i.au-plain, textarea.i.au-plain, .palette .in input { font-size: 16px; }
  .au-row.au-addr1 { grid-template-columns: minmax(0, 1fr) 88px; }
  .au-row.au-addr2 { grid-template-columns: 104px minmax(0, 1fr); }
  html, body { width: 100%; overflow-x: hidden; }
}

/* comptabilité : bilan sur deux colonnes (une seule sur téléphone) */
.dash.bilan-cols { grid-template-columns: 1fr 1fr; }
@media (max-width: 1200px) { .dash.bilan-cols { grid-template-columns: 1fr; } }

/* sélecteur d'application (Comptabilité · Facturation · Salaires) */
.apps { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; padding: 4px 4px 12px; margin: 0 0 6px; border-bottom: 1px solid rgba(255,255,255,.06); }
.apps button { border: 1px solid rgba(255,255,255,.08); background: rgba(255,255,255,.03); color: #9fb3c2; border-radius: 10px; padding: 9px 2px 7px; display: flex; flex-direction: column; align-items: center; gap: 5px; font: inherit; font-size: 11px; font-weight: 650; cursor: pointer; transition: all .12s; min-width: 0; }
.apps button span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.apps button svg.ic { width: 18px; height: 18px; }
.apps button:hover { color: #fff; background: rgba(255,255,255,.07); }
.apps button.on { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 4px 14px rgba(47,127,140,.35); }
@media (max-width: 1000px) and (min-width: 761px) { .apps { grid-template-columns: 1fr; grid-auto-flow: row; padding: 4px 6px 10px; } .apps button { padding: 8px 0; } .apps button span { display: none; } }

/* barre du haut : le fil d'Ariane occupe l'espace quand la recherche est masquée */
.topbar .crumb { flex: 1 1 auto; min-width: 130px; }
@media (max-width: 760px) { .topbar .crumb { min-width: 0; } }
.menu a .cnt { background: var(--red); color: #fff; border-radius: 9px; font-size: 11px; padding: 0 7px; font-weight: 700; }

/* création de société : titres de sections */
.setup-sec { display: flex; align-items: center; gap: 8px; border-top: 1px solid var(--line-2); padding-top: 14px; margin-top: 2px; font-weight: 700; font-size: 13.5px; color: var(--text); }
.setup-sec svg.ic { color: var(--brand); width: 17px; height: 17px; }

/* salaires : informations de l'employé et aperçu de la fiche */
.emp-info { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px 16px; padding: 12px 14px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; }
.emp-info span { display: block; font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--faint); font-weight: 650; }
.emp-info b { font-size: 13px; font-weight: 600; }
@media (max-width: 760px) { .emp-info { grid-template-columns: 1fr 1fr; } }
.slip-preview { width: 100%; height: 70vh; border: 1px solid var(--line); border-radius: 10px; background: #d5dbe1; display: block; }
tr.muted td { opacity: .6; }

/* Paramètres : barre Enregistrer / Annuler */
.setbar { position: sticky; bottom: 0; z-index: 5; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 16px; padding: 12px 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 -6px 20px rgba(16,24,40,.06); color: var(--muted); font-size: 13.5px; }
.setbar.dirty { border-color: #f5c27a; background: #fff9ef; color: #7a3e06; font-weight: 600; }
@media (max-width: 760px) { .setbar { bottom: calc(70px + env(safe-area-inset-bottom)); } .setbar .btn { flex: 1; } }

/* tri des tableaux par colonne */
table.t thead th:not(:empty) { cursor: pointer; user-select: none; }
table.t thead th:not(:empty):hover { color: var(--text); }
table.t thead th[data-sort]::after { content: " \25B2"; font-size: 9px; color: var(--brand); }
table.t thead th[data-sort="desc"]::after { content: " \25BC"; }

/* justificatifs scannés */
.scan { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 16px; align-items: start; }
.scan-img { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; min-height: 260px; max-height: 62vh; overflow: auto; display: grid; place-items: center; }
.scan-img img { max-width: 100%; display: block; }
.scan-text { white-space: pre-wrap; font-size: 11.5px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; max-height: 180px; overflow: auto; }
.attach-link { color: var(--brand); display: inline-grid; vertical-align: middle; margin-left: 4px; }
.attach-link svg.ic { width: 15px; height: 15px; }
@media (max-width: 760px) { .scan { grid-template-columns: 1fr; } .scan-img { max-height: 30vh; min-height: 120px; } }

/* comptabilité côté client : dépôt de pièces */
.deposit-btn { margin: 0; width: 100%; font: inherit; color: inherit; cursor: pointer; text-align: center; transition: border-color .15s, transform .15s; }
.deposit-btn:hover { border-color: var(--brand, #2f7f8c); transform: translateY(-1px); }
.deposit-btn svg { width: 26px; height: 26px; color: var(--brand, #2f7f8c); }
@media (max-width: 760px) { .deposit-btn .card-b { padding: 16px 12px !important; } .deposit-btn h3 { font-size: 15px; } }

/* pièces à comptabiliser : boutons toujours visibles, à la ligne sur mobile */
@media (max-width: 760px) { .list .it.inbox-it { flex-wrap: wrap; } .list .it.inbox-it .grow { flex-basis: calc(100% - 60px); } .list .it .btn.keep { display: inline-flex; } .list .it.inbox-it .btn.primary.keep { margin-left: auto; } }

/* bouton Actualiser */
#refresh-btn.spin svg { animation: spin .8s linear infinite; }

/* société courante : en haut du menu, logo centré */
.side-co { padding: 12px 14px 6px; }
.side-co .menu { left: 0; right: 0; top: calc(100% + 4px); min-width: 0; max-height: 65vh; overflow-y: auto; }
.company-chip.has-logo { flex-wrap: wrap; row-gap: 8px; padding: 10px; }
.company-chip.has-logo .co-logo { width: 100%; height: 50px; padding: 7px 14px; border-radius: 9px; }
.company-chip.has-logo .co-logo img { margin: 0 auto; max-height: 100%; }
.co-search { display: flex; align-items: center; gap: 6px; padding: 2px 4px 6px; color: var(--faint); }
.co-search input.i { height: 34px; }
.co-list .none { padding: 10px; color: var(--muted); font-size: 13px; }
@media (max-width: 1000px) and (min-width: 761px) { .side-co { padding: 10px 8px 4px; } .company-chip.has-logo .co-logo { height: 34px; padding: 4px; } }
/* barre de recherche : vrai champ de saisie */
.search-btn { cursor: text; }
.search-btn input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: inherit; font-size: 13.5px; color: var(--text); height: 100%; }
.search-btn input::placeholder { color: var(--faint); }
.search-btn input::-webkit-search-cancel-button { display: none; }
.search-btn:focus-within { border-color: var(--brand); background: #fff; box-shadow: 0 0 0 3px var(--brand-soft); }
.palette.drop { position: fixed; z-index: 120; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--sh-pop); animation: none; }
.palette.drop .res { max-height: 60vh; }
@media (max-width: 1000px) { .search-btn input, .search-btn kbd { display: none; } .search-btn { cursor: pointer; } }
/* téléphone : barre d'onglets collée au bas de l'écran, libellés compacts */
@media (max-width: 760px) {
  .tabbar { padding: 4px 2px max(6px, env(safe-area-inset-bottom)); box-shadow: 0 -4px 14px rgba(15,30,45,.06); }
  .tabbar::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 140px; background: inherit; }
  .tabbar a, .tabbar button { font-size: 10px; font-weight: 600; gap: 2px; padding: 5px 0 3px; letter-spacing: .01em; }
  .tabbar svg.ic { width: 23px; height: 23px; }
  .setup { flex-wrap: wrap; } .setup > div { min-width: 0; flex-basis: calc(100% - 40px) !important; } .setup .btn { width: 100%; justify-content: center; }
}
.crumb { flex: 1 1 auto; overflow: hidden; } .crumb b { overflow: hidden; text-overflow: ellipsis; }
@media (min-width: 1001px) { .search-btn { flex: 0 1 340px; min-width: 200px; } }
.menu .co[hidden] { display: none; }
@media (max-width: 760px) { .side-co .menu { position: absolute; top: calc(100% + 4px); left: 0 !important; right: 0 !important; max-height: 60vh; z-index: 95; } }
/* iPhone (iOS 26) : la zone sous la barre du bas prend la même couleur que la barre */
@media (max-width: 760px) { html { background: #fff; } .tabbar { background: #fff; backdrop-filter: none; } .tabbar::after { background: #fff; height: 200px; } }

/* visionneuse PDF / photo plein écran */
.fv { position: fixed; inset: 0; z-index: 300; background: #2a3440; display: flex; flex-direction: column; }
.fv-bar { display: flex; align-items: center; gap: 10px; padding: calc(10px + env(safe-area-inset-top)) 12px 10px; background: #0b1824; color: #fff; }
.fv-bar b { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 15px; }
.fv-x { width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255,255,255,.14); color: #fff; display: grid; place-items: center; flex: none; cursor: pointer; }
.fv-x svg { width: 22px; height: 22px; }
.fv-body { flex: 1; overflow: auto; -webkit-overflow-scrolling: touch; padding: 8px 8px calc(16px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; align-items: center; gap: 8px; }
.fv-body canvas, .fv-body img { background: #fff; box-shadow: 0 2px 10px rgba(0,0,0,.3); max-width: 100%; }
.fv-wait { color: #cfd8e0; padding: 40px 16px; text-align: center; }
body.fv-open .tabbar { display: none; }
@media (max-width: 760px) { .fv-bar .btn span { display: none; } }
.chk-line { display: flex; gap: 8px; align-items: center; padding: 6px 0; font-size: 13.5px; }

/* écriture multiple */
.ml-wrap { margin-top: 14px; overflow-x: auto; }
.ml-table { width: 100%; border-collapse: collapse; }
.ml-table th { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); text-align: left; padding: 4px 6px; }
.ml-table td { padding: 4px 4px; vertical-align: top; }
.ml-table td:first-child { width: 34%; } .ml-table td:nth-child(3) { width: 20%; } .ml-table td:nth-child(4) { width: 16%; }
.ml-table .f { margin: 0; }
.ml-table input.num { text-align: right; }
.ml-foot { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.ml-total { font-size: 14px; } .ml-total b { font-size: 16px; }
@media (max-width: 760px) { .ml-table thead { display: none; } .ml-table tr { display: grid; grid-template-columns: 1fr 1fr 36px; gap: 6px; padding: 10px 0; border-bottom: 1px solid var(--line-2); } .ml-table td { width: auto !important; padding: 0; } .ml-table td:first-child, .ml-table td:nth-child(2) { grid-column: 1 / span 3; } }

/* dépôt de plusieurs pièces */
.dep-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; margin-bottom: 12px; }
.dep-item { position: relative; aspect-ratio: 3/4; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: var(--panel-2); }
.dep-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dep-pdf { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 6px; font-size: 11px; text-align: center; color: var(--muted); word-break: break-all; }
.dep-x { position: absolute; top: 4px; right: 4px; width: 28px; height: 28px; border-radius: 50%; border: 0; background: rgba(11,24,36,.75); color: #fff; display: grid; place-items: center; cursor: pointer; }
.dep-x svg { width: 15px; height: 15px; }
.dep-empty { grid-column: 1 / -1; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 22px; border: 2px dashed var(--line); border-radius: 12px; color: var(--faint); }
.dep-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; } .dep-actions .btn { flex: 1; justify-content: center; min-height: 44px; }

/* ergonomie : téléphone */
@media (max-width: 760px) {
  input.i, select.i, textarea.i { font-size: 16px; }
  .btn { min-height: 40px; }
  .btn.sm { min-height: 34px; }
  .modal-f { gap: 8px; } .modal-f .btn { flex: 1 1 auto; justify-content: center; min-height: 46px; }
  .modal-h { position: sticky; top: 0; z-index: 2; background: #fff; }
  .modal-b { -webkit-overflow-scrolling: touch; }
  .toolbar { gap: 8px; } .toolbar .btn { flex: 1 1 auto; justify-content: center; }
  .page-h h1 { font-size: 22px; }
  .card-h h3 { font-size: 15px; }
}
/* ergonomie : ordinateur */
@media (min-width: 761px) {
  .modal-f .btn { min-width: 110px; justify-content: center; }
  .t td, .t th { overflow-wrap: anywhere; }
}
@media (max-width: 760px) { .card-h { flex-wrap: wrap; row-gap: 2px; } .card-h h3 { white-space: nowrap; } .card-h .sub { flex-basis: 100%; order: 3; padding-left: 38px; font-size: 12px; } }
.fv-frame { width: 100%; flex: 1; min-height: 70vh; border: 0; background: #fff; }

/* déductions de la facture (rabais global, prorata, escompte) sous les positions */
.ded-fields { display: grid; grid-template-columns: repeat(3, 130px); gap: 10px; }
@media (max-width: 760px) { .ded-fields { grid-template-columns: repeat(3, 1fr); width: 100%; } }

/* pièce PDF dans la fenêtre de comptabilisation */
.scan-pdf { display: flex; flex-direction: column; gap: 8px; max-height: 70vh; overflow: auto; }
.scan-pdf canvas { width: 100%; height: auto; background: #fff; border: 1px solid var(--line); border-radius: 6px; }

/* décompte TVA à l’écran (présentation AFC) */
.afc-screen { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.afc-screen .afc-sec { border-radius: 6px; }
@media (max-width: 760px) { .afc-screen { padding: 10px; } .afc-screen .afc-info { grid-template-columns: 1fr 1fr; } .afc-screen td:first-child { font-size: 12px; } .afc-screen .bx { width: 24mm; } }
@media (max-width: 760px) { .menu.open { z-index: 210; } }

/* ================= thème épuré (octobre 2026) =================
   Moins d'ombres, de dégradés et de pastilles de couleur : surfaces blanches,
   bordures fines, une seule couleur d'accent, typographie plus nette. */
:root {
  --bg: #f5f6f8; --panel-2: #fafbfc; --line: #e3e7ec; --line-2: #eef1f4;
  --text: #111a24; --text-2: #3a4653; --muted: #677382; --faint: #98a2ae;
  --side: #0c1620; --side-2: #131f2a; --side-text: #9aabb9;
  --r-sm: 6px; --r: 8px; --r-lg: 10px;
  --sh-1: none; --sh-2: 0 1px 2px rgba(16,24,40,.04);
  --sh-pop: 0 10px 30px rgba(16,24,40,.12), 0 1px 3px rgba(16,24,40,.06);
}
body { font-size: 13.8px; letter-spacing: -.003em; }

/* menu latéral */
.side { border-right: 0; }
.brand { padding: 18px 14px 12px; border-bottom: 0; }
.brand img { height: 38px; }
.side-co { padding: 4px 12px 8px; }
.company-chip { background: transparent; border: 1px solid rgba(255,255,255,.08) !important; border-radius: 9px; }
.company-chip:hover { background: rgba(255,255,255,.04); }
.company-chip.has-logo { padding: 8px; row-gap: 6px; }
.company-chip.has-logo .co-logo { height: 40px; padding: 6px 12px; border-radius: 6px; }
.company-chip b { font-size: 12.8px; } .company-chip span { font-size: 11.3px; color: #6c8193; }
.apps { gap: 2px; padding: 3px; margin: 4px 12px 8px; border: 1px solid rgba(255,255,255,.07); border-radius: 9px; background: rgba(255,255,255,.025); }
.apps button { border: 0; background: transparent; border-radius: 7px; padding: 7px 2px 6px; font-size: 11px; font-weight: 600; color: #8195a6; gap: 4px; }
.apps button svg.ic { width: 16px; height: 16px; }
.apps button:hover { background: rgba(255,255,255,.05); }
.apps button.on { background: rgba(255,255,255,.1); color: #fff; box-shadow: none; }
.apps button.on svg.ic { color: var(--brand-3); }
.nav { padding: 4px 12px 12px; }
.nav-sec { font-size: 10.5px; letter-spacing: .08em; color: #536879; padding: 14px 10px 5px; }
.nav a { padding: 7.5px 10px; border-radius: 7px; font-size: 13.4px; gap: 10px; }
.nav a svg.ic { width: 16px; height: 16px; opacity: .85; }
.nav a.active { background: rgba(255,255,255,.08); color: #fff; }
.nav a.active::before { left: -12px; top: 9px; bottom: 9px; width: 2px; }
.side-foot { border-top: 1px solid rgba(255,255,255,.05); padding: 10px 16px 12px; }

/* barre du haut */
.topbar { border-bottom-color: var(--line); }
@media (min-width: 761px) { .topbar { --top-h: 56px; height: 56px; padding: 0 24px; } }
/* téléphone : la barre du haut passe sous l'encoche / la barre d'état, toutes les icônes restent visibles */
@media (max-width: 760px) {
  .topbar { padding: env(safe-area-inset-top) 8px 0 12px; height: calc(56px + env(safe-area-inset-top)); gap: 2px; position: relative; z-index: 60; }
  .topbar .crumb { flex: 1 1 0; min-width: 0; }
  .topbar > *:not(.crumb) { flex: none; }
  .topbar .icon-btn, .topbar .search-btn { width: 36px; height: 36px; padding: 0; justify-content: center; }
  .topbar #new-btn { width: 36px; height: 36px; }
}
.crumb { font-size: 13.2px; }
.search-btn { height: 34px; border-radius: 8px; background: var(--bg); border-color: transparent; }
.search-btn:hover { background: #eff1f4; border-color: transparent; }
.icon-btn { width: 34px; height: 34px; border-radius: 8px; color: var(--muted); }
.icon-btn:hover { color: var(--text); }
.user-btn .avatar { width: 30px; height: 30px; }

/* en-têtes de page */
@media (min-width: 761px) {
  .page-h { padding: 28px 32px 20px; }
  .content { padding: 0 32px 48px; }
}
.page-h h1 { font-size: 22px; font-weight: 650; letter-spacing: -.022em; }
.page-h .lead { font-size: 13.2px; }

/* boutons */
.btn { height: 34px; border-radius: 8px; border-color: #dde2e8; box-shadow: none; font-weight: 600; font-size: 13.2px; padding: 0 13px; color: var(--text-2); }
.btn:hover { background: #f6f7f9; border-color: #cfd5dc; }
.btn.primary { box-shadow: none; }
.btn.sm { height: 28px; border-radius: 7px; font-size: 12.5px; }
.btn.icon { width: 34px; } .btn.sm.icon { width: 28px; }

/* cartes */
.card, .table-card, .kpi { border-radius: var(--r-lg); border-color: var(--line); box-shadow: var(--sh-2); }
.card { margin-bottom: 16px; }
.card-h { min-height: 52px; padding: 12px 18px; border-bottom-color: var(--line-2); }
.card-h h3 { font-size: 14px; font-weight: 620; gap: 9px; }
.card-h h3 .ico { width: auto; height: auto; background: none; color: var(--faint); border-radius: 0; }
.card-h h3 .ico svg.ic { width: 17px; height: 17px; }
.card-b { padding: 18px; }
.card-f { padding: 11px 18px; border-radius: 0 0 var(--r-lg) var(--r-lg); }

/* tableau de bord */
.kpis { gap: 14px; }
.kpi { padding: 16px 18px; }
.kpi .l { font-size: 12.5px; font-weight: 550; }
.kpi .ico { width: 30px; height: 30px; border-radius: 7px; background: var(--bg) !important; color: var(--muted) !important; }
.kpi .ico svg.ic { width: 16px; height: 16px; }
.kpi .v { font-size: 24px; font-weight: 650; margin-top: 8px; }
.kpi .bar { height: 4px; }
.quick { gap: 12px; }
.quick a { border-radius: var(--r-lg); padding: 12px 14px; font-weight: 600; box-shadow: var(--sh-2); }
.quick a:hover { transform: none; border-color: #c9d1d9; box-shadow: var(--sh-2); }
.quick a .ico { width: 34px; height: 34px; border-radius: 8px; background: var(--bg); color: var(--text-2); }
.setup { background: var(--side); border-radius: var(--r-lg); }

/* tableaux */
table.t th { font-size: 11px; letter-spacing: .05em; font-weight: 600; color: var(--muted); background: #fff; padding: 10px 16px; }
table.t td { padding: 12px 16px; }
table.t tbody tr.click:hover td, .list .it:hover { background: #f8f9fb; }
table.t tfoot td { background: var(--panel-2); font-weight: 600; }
/* les dates ne se coupent jamais en deux lignes */
table.t td.d { white-space: nowrap; overflow-wrap: normal; }
@media (max-width: 1280px) and (min-width: 761px) { table.t th, table.t td { padding-left: 12px; padding-right: 12px; } }
.docno { font-weight: 600; }

/* filtres, champs, badges */
.tabs { background: #eceff2; border-radius: 9px; padding: 3px; }
.tabs button { padding: 5px 11px; border-radius: 7px; font-size: 12.8px; font-weight: 550; color: var(--muted); }
.tabs button.on { color: var(--text); font-weight: 600; box-shadow: 0 1px 2px rgba(16,24,40,.08); }
.tabs button .n { background: transparent; padding: 0 2px; }
.tabs button.on .n { background: transparent; color: var(--muted); }
input.i, select.i, textarea.i { border-color: #d9dee4; border-radius: 8px; height: 36px; font-size: 13.6px; }
textarea.i { height: auto; }
input.i:focus, select.i:focus, textarea.i:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(47,127,140,.12); }
label.f { font-size: 12.5px; font-weight: 600; gap: 5px; }
.badge { font-size: 11.5px; font-weight: 600; border-radius: 6px; padding: 2px 8px 2px 7px; gap: 5px; }
.badge::before { width: 5px; height: 5px; }
.notice { border-radius: 8px; font-size: 13px; }
.empty .ill, .drop .ill { background: var(--bg); color: var(--muted); border-radius: 12px; }

/* fenêtres et menus */
.modal { border-radius: 12px; box-shadow: 0 24px 60px rgba(11,24,36,.22); }
.modal-h { padding: 15px 20px; }
.modal-h h2 { font-size: 16px; font-weight: 650; }
.modal-h .ico { width: 32px; height: 32px; border-radius: 8px; background: var(--bg); color: var(--text-2); }
.modal-b { padding: 18px 20px; }
.modal-f { padding: 12px 20px; border-radius: 0 0 12px 12px; }
.menu { border-radius: 10px; }
.menu button, .menu a { border-radius: 6px; font-size: 13.2px; padding: 7px 10px; }
.snav button { border-radius: 8px; font-size: 13.4px; padding: 8px 12px; }
.snav button.on { box-shadow: none; border: 1px solid var(--line); }
.toast { border-radius: 10px; }

/* éditeur de documents */
.ed-head { background: rgba(245,246,248,.96); }
.ed-head h1 { font-size: 19px; font-weight: 650; }
.sum-box .r.g { font-weight: 650; font-size: 16.5px; }

@media (max-width: 760px) {
  .card, .table-card, .kpi { border-radius: 10px; }
  .brand img { height: 36px; }
}

/* échanges sur une pièce (question de la fiduciaire / réponse du client) */
.ib-thread { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; max-width: 620px; }
.ib-msg { border-radius: 10px; padding: 7px 11px; font-size: 13px; line-height: 1.45; border: 1px solid var(--line); background: var(--panel-2); }
.ib-msg.fid { background: var(--violet-soft); border-color: #e0d4f7; }
.ib-msg.cl { background: var(--brand-soft); border-color: #cfe5e9; }
.ib-msg p { margin: 2px 0 0; white-space: pre-wrap; }
.ib-who { display: flex; gap: 8px; align-items: baseline; font-size: 11.5px; color: var(--muted); }
.ib-who b { color: var(--text-2); font-size: 12px; }
.ib-files { display: flex; flex-wrap: wrap; gap: 6px; }
.list .it.inbox-it { align-items: flex-start; }
.list .it.inbox-it > .btn, .list .it.inbox-it > .badge { margin-top: 2px; }
.list .it.ib-q { background: #fbf9ff; }
.modal .ib-thread { margin: 0 0 12px; max-width: none; }

/* bilan d’ouverture : case de montant assez large pour les montants complets */
.ob-cols { display: grid; grid-template-columns: 1fr; gap: 14px; }
.ob-cols table.t td { padding-top: 9px; padding-bottom: 9px; font-size: 14px; }
.ob-cols table.t { table-layout: fixed; }
td.ob-cell { width: 42%; }
input.i.ob-in { width: 100%; max-width: 240px; min-width: 0; height: 40px; font-size: 15px; text-align: right; font-variant-numeric: tabular-nums; }
input.i.ob-in.neg { color: var(--red); }
@media (max-width: 760px) { .ob-cols table.t { table-layout: auto; } td.ob-cell { width: auto; } input.i.ob-in { max-width: none; } }

input.i.ob-in.ob-auto { background: var(--panel-2); color: var(--text-2); font-weight: 600; cursor: default; }
.ob-cols table.t th.num { width: 42%; }
.ob-cols table.t th { white-space: normal; }

/* sélection multiple : barre d'actions et case à cocher dans les listes */
.bulkbar { display: flex; align-items: center; gap: 10px; padding: 9px 14px; margin-bottom: 10px; background: var(--brand-soft); border: 1px solid #cfe5e9; border-radius: 10px; color: var(--brand-ink); font-size: 13.5px; position: sticky; top: 0; z-index: 4; }
.bulkbar[hidden] { display: none; }
table.t td.c-sel, table.t th.c-sel { width: 34px; padding-right: 0; }
@media (max-width: 760px) {
  table.t tr:has(> td.c-sel) { position: relative; padding-left: 44px; }
  table.t td.c-sel { position: absolute; left: 14px; top: 14px; width: auto; }
  table.t thead th.c-sel { display: none; }
}

/* barre de mise en forme sous la désignation d'une position */
.lines-ed .fmtbar { display: flex; align-items: center; gap: 2px; margin-top: 5px; }
.lines-ed .fmtbar button { border: 1px solid transparent; background: none; cursor: pointer; color: var(--muted); height: 26px; min-width: 28px; padding: 0 7px; border-radius: 6px; display: inline-flex; align-items: center; gap: 5px; font: inherit; font-size: 12px; font-weight: 600; }
.lines-ed .fmtbar button svg.ic { width: 15px; height: 15px; }
.lines-ed .fmtbar button:hover { color: var(--text); background: var(--grey-soft); }
.lines-ed .fmtbar button.on { color: var(--brand-ink); background: var(--brand-soft); border-color: #cfe5e9; }
.lines-ed .fmtbar .sep { width: 1px; height: 16px; background: var(--line); margin: 0 5px; }

/* module Suivi fiduciaire : application intégrée sur toute la zone de contenu */
.suivi-frame { display: block; width: 100%; height: 100%; border: 0; background: #f6f7f9; }
.main:has(> .suivi-frame) { padding: 0 !important; overflow: hidden; }

/* bouton « Suivi » (barre du haut) */
.icon-btn.suivi-btn { width: auto; display: inline-flex; align-items: center; gap: 6px; padding: 0 11px; font: inherit; font-size: 13px; font-weight: 600; color: var(--text-2); border: 1px solid var(--line); }
.icon-btn.suivi-btn svg.ic { width: 16px; height: 16px; }
.icon-btn.suivi-btn.on { background: var(--brand-soft); color: var(--brand-ink); border-color: #cfe5e9; }
@media (max-width: 760px) { .icon-btn.suivi-btn { width: 36px; padding: 0; justify-content: center; border-color: transparent; } .icon-btn.suivi-btn span { display: none; } }
/* sous-positions des factures et devis : décalées, avec un repère à gauche */
.lines-ed tr.sub td:first-child { padding-left: 34px !important; position: relative; }
.lines-ed tr.sub td:first-child::before { content: ""; position: absolute; left: 14px; top: 8px; bottom: 8px; width: 3px; border-radius: 2px; background: var(--brand-soft, #d6eef2); }
.lines-ed tr.sub .submark { display: none; }
.lines-ed .fmtbar .subadd { color: var(--brand-ink); }
/* page de l'employé : éditeur à gauche, aperçu de la fiche à droite */
.emp-split { display: grid; grid-template-columns: minmax(0, 1fr) clamp(320px, 40%, 620px); gap: 18px; align-items: start; }
.emp-main { min-width: 0; }
.emp-pv { position: sticky; top: 10px; height: calc(100vh - 150px); min-height: 420px; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #d5dbe1; }
@media (max-width: 1150px) { .emp-split { grid-template-columns: 1fr; } .emp-pv { display: none; } }
/* fiche du mois : affichée seulement dans l'aperçu à droite ; sur écran étroit (aperçu masqué), affichée dans la page */
.emp-slip-inline { display: none; }
@media (max-width: 1150px) { .emp-slip-inline { display: block; } }

/* bilan comparé à l’année précédente : actifs puis passifs l’un sous l’autre */
.dash.bilan-cmp { grid-template-columns: 1fr; }

/* flèches précédente / suivante */
.nav-arrows { display: flex; gap: 2px; flex: none; margin-right: 6px; }
.nav-arrows .icon-btn { width: 32px; height: 32px; }
.nav-arrows .icon-btn:disabled { opacity: .35; cursor: default; background: none; }
@media (max-width: 760px) { .nav-arrows { margin-right: 2px; } .nav-arrows .icon-btn { width: 30px; height: 30px; } }

/* import bancaire : paiement regroupé réparti en plusieurs lignes */
.split-row > td { background: var(--grey-soft); border-top: 0; }
.split-box { padding: 4px 0 6px; }
.split-line { display: grid; grid-template-columns: minmax(160px,1.2fr) minmax(200px,1.5fr) 120px minmax(150px,1fr) 34px; gap: 6px; align-items: center; margin-bottom: 6px; }
.split-line .i { height: 34px; min-width: 0; }
.split-h { margin-bottom: 2px; }
.split-foot { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 4px; }
@media (max-width: 760px) { .split-line { grid-template-columns: 1fr 1fr; } .split-h { display: none; } }

/* import bancaire : bouton « Valider » toujours visible à droite du tableau */
.t .post-c { position: sticky; right: 0; background: var(--panel); box-shadow: -8px 0 8px -8px rgba(0,0,0,.18); z-index: 1; }
.split-row > td.post-c { background: var(--grey-soft); }

/* présence sur le dossier : bandeau client, pastille et verrou entre administrateurs */
.main-wrap { position: relative; }
.pres-chip { display: flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: var(--grey-soft); font-size: 12.5px; color: var(--text-2); white-space: nowrap; max-width: 320px; overflow: hidden; text-overflow: ellipsis; flex: 0 1 auto; }
.pres-chip svg.ic { width: 14px; height: 14px; flex: none; }
.pres-chip span { overflow: hidden; text-overflow: ellipsis; }
.pres-lock-card { max-width: 520px; width: 100%; text-align: center; }
.pres-lock-card > .card-b > svg.ic { width: 34px; height: 34px; color: var(--amber, #b7791f); }
.pres-lock-card h3 { margin: 10px 0 6px; }
.pres-lock-card p { color: var(--text-2); line-height: 1.5; margin: 0 0 16px; }
.pres-lock-acts { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
@media (max-width: 760px) { .pres-chip { display: none; } }
/* présence : fenêtre au milieu (client : tout l'écran ; administrateur : zone de travail, le menu reste utilisable) */
.pres-modal { position: fixed; top: 0; right: 0; bottom: 0; z-index: 900; display: grid; place-items: center; padding: 24px 16px; background: rgba(15, 23, 42, .45); backdrop-filter: blur(3px); overflow-y: auto; }
.pres-modal .pres-lock-card { box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.pres-modal .pres-lock-card > .card-b > svg.ic { width: 34px; height: 34px; color: var(--amber, #b7791f); }
.pres-modal .pres-lock-acts .btn svg.ic { width: 16px; height: 16px; }
.pres-urg { text-align: left; display: grid; gap: 8px; padding: 14px; border-radius: 10px; background: var(--panel-2, #f6f7f9); border: 1px solid var(--line); font-size: 13.5px; line-height: 1.45; }
.pres-urg textarea.i { min-height: 90px; resize: vertical; height: auto; }
.pres-urg .pres-lock-acts { justify-content: flex-start; }
.toasts { z-index: 1000; }

/* devis / factures : ajustements (rabais, régie, prorata, déchets, escompte, arrêté) */
.ded-fields { grid-template-columns: repeat(3, 150px); }
.ded-fields .ded-wide { grid-column: span 2; }
@media (max-width: 760px) { .ded-fields { grid-template-columns: repeat(2, 1fr); } }
/* paramètres : certifications */
.cert-prev { position: relative; height: 54px; padding: 4px; border: 1px solid var(--line); border-radius: 8px; background: #fff; display: flex; align-items: center; }
.cert-prev img { max-height: 46px; max-width: 140px; }
.cert-prev .btn { position: absolute; top: -8px; right: -8px; background: var(--panel); border: 1px solid var(--line); width: 22px; height: 22px; padding: 0; }
/* nouvelle version disponible */
.upd-bar { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 1001; display: flex; align-items: center; gap: 12px; padding: 10px 14px 10px 16px; border-radius: 12px; background: #0f2a3d; color: #fff; box-shadow: 0 12px 40px rgba(0,0,0,.3); font-size: 14px; }
.upd-bar svg.ic { width: 18px; height: 18px; }
@media (max-width: 760px) { .upd-bar { left: 12px; right: 12px; transform: none; bottom: calc(84px + env(safe-area-inset-bottom)); } }
.lines-ed tr.room td { background: color-mix(in srgb, var(--brand, #2f7f8c) 12%, var(--panel)); border-top: 2px solid var(--brand, #2f7f8c); }
.room-h { display: flex; align-items: center; gap: 10px; }
.room-h svg.ic { width: 18px; height: 18px; color: var(--brand, #2f7f8c); flex: none; }
.room-h .i { max-width: 300px; height: 34px; font-weight: 700; color: var(--brand, #2f7f8c); background: var(--panel); }
.room-n { font-size: 12px; color: var(--muted); white-space: nowrap; }
.room-st { font-size: 13px; color: var(--text-2); white-space: nowrap; }
.room-st b { color: var(--text); font-size: 14px; margin-left: 4px; }
.lines-ed tr.room-add td { padding: 6px 8px 14px; border-bottom: 1px solid var(--line); }
.lines-ed tr.room-add td:first-child { display: flex; gap: 8px; align-items: center; }
.lines-ed tr.room-add select { max-width: 420px; height: 32px; }
.lines-ed tr.noroom-h td { padding: 12px 8px 6px; font-size: 13px; font-weight: 700; color: var(--text-2); border-top: 2px dashed var(--line); }
.lines-ed tr.noroom-h td svg.ic { width: 15px; height: 15px; vertical-align: -2px; margin-right: 6px; }
.lines-ed tr.noroom-h td span { font-weight: 400; color: var(--muted); }

/* pièces : une couleur par pièce (bandeau plein, positions et ligne d'ajout teintées avec un liseré) */
.lines-ed tr.room > td { background: var(--rc, #1f7a8c) !important; border-top: 0 !important; }
.lines-ed tr.room { background: var(--rc, #1f7a8c); border-radius: 10px 10px 0 0; margin-top: 14px; }
.lines-ed tr.room .room-h svg.ic, .lines-ed tr.room .room-n, .lines-ed tr.room .room-st b, .lines-ed tr.room .ops button { color: #fff; }
.lines-ed tr.room .ops button:hover { background: rgba(255,255,255,.18); color: #fff; }
.lines-ed tr.room .room-h .i { background: #fff; color: var(--rc, #1f7a8c); border-color: transparent; }
.lines-ed tr.room .room-st b { font-size: 15px; }
.lines-ed tr.in-room, .lines-ed tr.in-room > td, .lines-ed tr.in-room .w-tot { background: color-mix(in srgb, var(--rc) 7%, var(--panel)); }
.lines-ed tr.in-room { box-shadow: inset 5px 0 0 var(--rc); }
.lines-ed tr.in-room > td:first-child { box-shadow: inset 5px 0 0 var(--rc); padding-left: 14px !important; }
.lines-ed tr.room-add.in-room { border-radius: 0 0 10px 10px; margin-bottom: 6px; }
.lines-ed tr.room-add.in-room > td:first-child { border-bottom: 0; }
.lines-ed tr.room-add .btn { color: var(--rc); border-color: color-mix(in srgb, var(--rc) 40%, transparent); background: var(--panel); }
.lines-ed tr.room > td:first-child { flex: 1 1 0 !important; margin-bottom: 0 !important; }
.lines-ed tr.ln.room { padding: 8px 10px !important; align-items: center !important; }
.lines-ed tr.ln.in-room { padding-left: 14px !important; padding-right: 8px !important; }
.lines-ed tr.ln.in-room > td:first-child { box-shadow: none; padding-left: 0 !important; }
.lines-ed tr.room-add.in-room > td:first-child { padding-left: 14px !important; }
/* barre du bas : ajout d'une pièce à côté des ajouts de positions */
.room-add-inline { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 10px; border: 1.5px solid var(--brand, #1f7a8c); border-radius: 10px; background: var(--brand-soft, #e8f3f5); margin-right: 6px; }
.room-add-inline svg.ic { width: 16px; height: 16px; color: var(--brand, #1f7a8c); flex: none; }
.room-add-inline .i { width: 230px; height: 32px; }
.lines-ed tr.room-add { display: flex; width: 100%; } .lines-ed tr.room-add > td:first-child { flex: 1; min-width: 0; } .lines-ed tr.room-add > td:last-child:not(:first-child) { display: none; }
.lines-ed tr.noroom-h { display: flex; width: 100%; } .lines-ed tr.noroom-h > td:first-child { flex: 1; }
/* journal : total des écritures en haut du tableau */
.jtotal { display: flex; align-items: center; gap: 8px; padding: 10px 16px; margin-bottom: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-2); font-weight: 650; font-size: 14px; }
.jtotal b { font-size: 16px; }

/* éditeur : lignes hors groupe, couleur douce qui alterne */
.lines-ed tr.ln.soft-line { box-shadow: inset 4px 0 0 var(--rc); background: color-mix(in srgb, var(--rc) 4%, var(--panel)); padding-left: 12px !important; padding-right: 8px !important; }
.lines-ed tr.ln.soft-line > td { background: transparent; }
/* groupes de positions sur téléphone : rien ne dépasse, ajout d'un groupe sur toute la largeur */
.lines-ed tr.ln.room, .lines-ed tr.ln.in-room, .lines-ed tr.room-add, .lines-ed tr.ln.soft-line { box-sizing: border-box; max-width: 100%; }
@media (max-width: 760px) {
  .room-add-inline { display: flex; flex-wrap: wrap; width: 100%; box-sizing: border-box; margin-right: 0; }
  .room-add-inline .i { flex: 1 1 160px; width: auto; min-width: 0; }
  .room-add-inline .btn { flex: 1 1 100%; justify-content: center; }
  .lines-ed tr.room .room-h { flex-wrap: wrap; } .lines-ed tr.room .room-h .i { flex: 1 1 150px; max-width: none; min-width: 0; }
  .lines-ed tr.room-add > td:first-child { flex-wrap: wrap; } .lines-ed tr.room-add select { flex: 1 1 100%; max-width: none; min-width: 0; }
}

/* téléphone : menu latéral — Suivi, Paramètres, Actualiser (retirés de la barre du haut) */
.side-mob { display: none; }
@media (max-width: 760px) {
  .topbar #nav-fwd, .topbar #refresh-btn, .topbar #set-btn { display: none !important; }
  /* téléphone : bouton Fiduciaire visible (icône seule) */
  .topbar #suivi-btn { display: grid !important; place-items: center; width: 34px; padding: 0; } .topbar #suivi-btn span:not(.dot) { display: none; } .topbar .icon-btn { width: 34px; }
  .topbar .crumb b { font-size: 15px; }
  .side-mob { display: flex; flex-direction: column; gap: 1px; padding: 6px 12px 8px; border-top: 1px solid rgba(255,255,255,.06); }
  .side-mob button { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border: 0; background: none; border-radius: 8px; color: var(--side-text); font: inherit; font-size: 14.5px; font-weight: 500; text-align: left; cursor: pointer; }
  .side-mob button svg.ic { width: 16px; height: 16px; opacity: .85; }
  /* actions secondaires rangées sous « Plus » */
  .toolbar .more-btn { flex: none; }
  .more-sheet { position: fixed; inset: 0; z-index: 120; background: rgba(11,24,36,.45); display: flex; align-items: flex-end; }
  .more-sheet[hidden] { display: none; }
  .more-box { width: 100%; background: var(--panel); border-radius: 16px 16px 0 0; padding: 10px 14px calc(14px + env(safe-area-inset-bottom)); max-height: 80dvh; overflow-y: auto; box-shadow: 0 -10px 30px rgba(0,0,0,.18); }
  .more-h { font-size: 12px; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 6px 4px 10px; }
  .more-list { display: flex; flex-direction: column; gap: 6px; }
  .more-list .btn { width: 100%; justify-content: flex-start; height: 46px; font-size: 15px; gap: 12px; }
  .more-box .more-close { width: 100%; margin-top: 10px; height: 44px; justify-content: center; background: var(--panel-2); }
  /* bilan et compte de résultat : vrais tableaux (compte, intitulé, montant sur la même ligne) */
  table.t.fin { display: table; width: 100%; }
  table.t.fin thead { display: table-header-group; } table.t.fin tbody { display: table-row-group; }
  table.t.fin tr { display: table-row; padding: 0; }
  table.t.fin td, table.t.fin th { display: table-cell; padding: 8px 10px !important; font-size: 13px; border-bottom: 1px solid var(--line-2) !important; vertical-align: top; }
  table.t.fin th { font-size: 10.5px; }
  table.t.fin td:first-child.muted { width: 44px !important; padding-right: 0 !important; font-size: 12px; }
  table.t.fin td.num { text-align: right; white-space: nowrap; }
  table.t.fin td:empty { display: table-cell; }
  table.t.fin td::before { display: none !important; }
}
@media (max-width: 760px) {
  /* journal : fiche compacte (date, pièce et montant sur la première ligne, puis libellé, débit, crédit) */
  table.t.jr tbody tr { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "d p m" "l l l" "db db db" "cr cr cr"; gap: 3px 10px; padding: 11px 14px; }
  table.t.jr tbody tr:has(> td.c-sel) { padding-left: 44px; }
  table.t.jr td[data-label="Date"] { grid-area: d; font-size: 13px; }
  table.t.jr td[data-label="Pièce"] { grid-area: p; font-size: 13px; }
  table.t.jr td[data-label="Montant"] { grid-area: m; text-align: right; font-size: 15px; }
  table.t.jr td[data-label="Libellé"] { grid-area: l; font-size: 14.5px; font-weight: 550; }
  table.t.jr td[data-label="Débit"] { grid-area: db; } table.t.jr td[data-label="Crédit"] { grid-area: cr; }
  table.t.jr td[data-label="Date"]::before, table.t.jr td[data-label="Pièce"]::before, table.t.jr td[data-label="Montant"]::before, table.t.jr td[data-label="Libellé"]::before { display: none !important; }
  table.t.jr td[data-label="Débit"]::before, table.t.jr td[data-label="Crédit"]::before { display: inline-block !important; width: 46px; margin: 0 !important; }
  table.t.jr td.c-sel { top: 12px; }
}
@media (max-width: 760px) {
  /* paramètres : barre « Enregistrer » collée au-dessus du menu du bas, seulement s'il y a des changements */
  .setbar { bottom: 8px; }
  .setbar:not(.dirty) { display: none; }
  /* onglets des paramètres : une seule ligne qui défile */
  .snav { flex-wrap: nowrap !important; overflow-x: auto; scrollbar-width: none; margin: 0 -12px; padding: 0 12px 2px; }
  .snav::-webkit-scrollbar { display: none; }
  .snav button { flex: none; }
}
@media (max-width: 760px) {
  /* positions : la barre de mise en forme ne doit jamais élargir la ligne (le rabais sortait de l'écran) */
  .lines-ed tr.ln:not(.txt):not(.sect) { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .lines-ed tr.ln > td { min-width: 0; }
  .lines-ed .fmtbar { flex-wrap: wrap; row-gap: 2px; max-width: 100%; }
  .lines-ed .fmtbar .sep { display: none; }
}
@media (max-width: 760px) { .lines-ed tr.room-add td:first-child { flex-wrap: wrap; } .lines-ed tr.room-add select { min-width: 0; flex: 1 1 160px; max-width: 100%; } }
@media (max-width: 760px) {
  /* fiche de salaire : vrai tableau (libellé, base, taux, montant), pas de fiches empilées */
  table.t.slip-tbl { display: table; width: 100%; table-layout: auto; }
  table.t.slip-tbl thead { display: table-header-group; } table.t.slip-tbl tbody { display: table-row-group; } table.t.slip-tbl tfoot { display: table-footer-group; }
  table.t.slip-tbl tr { display: table-row; padding: 0; }
  table.t.slip-tbl td, table.t.slip-tbl th { display: table-cell; padding: 7px 6px !important; font-size: 12.5px; border-bottom: 1px solid var(--line-2) !important; vertical-align: top; }
  table.t.slip-tbl th { font-size: 10px; letter-spacing: .03em; white-space: normal; }
  table.t.slip-tbl td.num, table.t.slip-tbl th.num { text-align: right; white-space: nowrap; }
  table.t.slip-tbl td:empty { display: table-cell; }
  table.t.slip-tbl td::before { display: none !important; }
  table.t.slip-tbl td:first-child, table.t.slip-tbl th:first-child { padding-left: 10px !important; }
  table.t.slip-tbl td:last-child, table.t.slip-tbl th:last-child { padding-right: 10px !important; }
}
@media (max-width: 760px) { .lines-ed .fmtbar button { min-width: 26px; padding: 0 5px; } }
@media (max-width: 760px) {
  /* import bancaire : une fiche par mouvement (date + montant, puis texte, compte, TVA, Valider) */
  table.t.imp tbody tr:not(:has(> td[colspan])) { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "c d m" "x x x" "a a a" "v v v" "p p p"; gap: 6px 10px; }
  table.t.imp tbody tr > td:nth-child(1) { grid-area: c; align-self: center; }
  table.t.imp tbody tr > td:nth-child(2) { grid-area: d; align-self: center; }
  table.t.imp tbody tr > td:nth-child(3) { grid-area: x; }
  table.t.imp tbody tr > td:nth-child(4) { grid-area: m; text-align: right; align-self: center; font-size: 15px; }
  table.t.imp tbody tr > td:nth-child(5) { grid-area: a; }
  table.t.imp tbody tr > td:nth-child(6) { grid-area: v; }
  table.t.imp tbody tr > td:nth-child(7) { grid-area: p; text-align: right; }
  table.t.imp tbody tr > td:nth-child(2)::before, table.t.imp tbody tr > td:nth-child(4)::before { display: none !important; }
  table.t.imp td .i { min-width: 0 !important; width: 100% !important; max-width: 100%; }
  table.t.imp td.post-c .btn { width: 100%; justify-content: center; height: 40px; }
  /* pied de carte : texte d'aide au-dessus du bouton, pleine largeur */
  .card-f { flex-wrap: wrap; padding: 12px 14px; }
  .card-f > span[style*="flex:1"], .card-f > .small { flex: 1 1 100% !important; }
  .card-f > .btn { flex: 1 1 auto; justify-content: center; }
  /* champs dans les tableaux : jamais plus larges que leur case */
  table.t td input.i, table.t td select.i { max-width: 100%; }
}
/* téléphone : vraie liste déroulante des pièces / groupes (la liste de suggestions n'apparaît pas sur iPhone) */
.room-add-inline .room-pick { display: none; }
@media (max-width: 760px) {
  .room-add-inline .room-pick { display: block; flex: 1 1 100%; width: 100%; height: 40px; }
  .room-add-inline #roomname::placeholder { color: var(--faint); }
}

/* dictée des factures et devis */
.lines-add .dict-btn { color: var(--brand-ink, #155e6b); border-color: var(--brand, #1f7a8c); background: var(--brand-soft, #e8f3f5); }
.dict-mic { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 100%; padding: 18px 12px; margin-bottom: 12px; border: 2px dashed var(--brand, #1f7a8c); border-radius: 14px; background: var(--brand-soft, #e8f3f5); color: var(--brand-ink, #155e6b); font: inherit; font-weight: 650; font-size: 15px; cursor: pointer; }
.dict-mic svg.ic { width: 34px; height: 34px; }
.dict-mic.on { border-style: solid; background: #fdecec; border-color: var(--red, #c0392b); color: var(--red, #c0392b); animation: dictpulse 1.4s ease-in-out infinite; }
@keyframes dictpulse { 50% { box-shadow: 0 0 0 8px rgba(192,57,43,.12); } }
@media (max-width: 760px) { .lines-add .dict-btn { width: 100%; justify-content: center; height: 42px; font-size: 15px; margin-bottom: 8px; } }

/* page de l'employé : catégories en colonne à gauche (fiche de l'employé, puis le mois, puis l'historique) */
.emp-body { display: grid; grid-template-columns: 196px minmax(0, 1fr); gap: 14px; align-items: start; }
.emp-split:has(.emp-nav) { grid-template-columns: minmax(0, 1fr) clamp(300px, 33%, 560px); }
@media (max-width: 1150px) { .emp-split:has(.emp-nav) { grid-template-columns: 1fr; } }
.emp-nav { position: sticky; top: 10px; display: flex; flex-direction: column; gap: 2px; padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.emp-nav-sec { font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); padding: 10px 10px 4px; }
.emp-nav-sec:first-child { padding-top: 4px; }
.emp-nav button { display: flex; align-items: center; gap: 9px; width: 100%; text-align: left; padding: 8px 10px; border: 0; border-radius: 8px; background: none; color: var(--text); font: inherit; font-size: 13.5px; cursor: pointer; }
.emp-nav button svg { width: 16px; height: 16px; flex: none; opacity: .75; }
.emp-nav button span:first-of-type { flex: 1; min-width: 0; }
.emp-nav button:hover { background: var(--panel-2); }
.emp-nav button.on { background: var(--brand-soft); color: var(--brand-ink); font-weight: 600; }
.emp-nav button.on svg { opacity: 1; }
@media (max-width: 760px) {
  .emp-body { grid-template-columns: minmax(0, 1fr); }
  .emp-nav { position: static; flex-direction: row; overflow-x: auto; padding: 4px; gap: 4px; }
  .emp-nav-sec { display: none; }
  .emp-nav button { width: auto; white-space: nowrap; flex: none; }
}
/* colonne du formulaire étroite (catégories à gauche + aperçu à droite) : 2 champs par ligne au lieu de 4 */
#ebody { container-type: inline-size; }
@container (max-width: 620px) { #ebody .grid.g4, #ebody .grid.g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } #ebody .grid .span3, #ebody .grid .span4 { grid-column: 1 / -1; } }
@container (max-width: 380px) { #ebody .grid.g4, #ebody .grid.g3, #ebody .grid.g2 { grid-template-columns: minmax(0, 1fr); } #ebody .grid .span2 { grid-column: 1 / -1; } }
/* pages de connexion : lien et mention « protection des données » (nLPD) */
.au-foot a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.au-privacy { font-size: 12.5px; color: var(--muted); margin: 4px 0 12px; line-height: 1.5; }
.au-privacy a { color: inherit; text-decoration: underline; }

/* ---------- assistant (administrateurs) : panneau à droite, propositions à approuver ---------- */
.asst-btn { color: var(--brand); }
.asst-bg { position: fixed; inset: 0; background: rgba(15, 23, 32, .28); z-index: 80; }
.asst { position: fixed; top: 0; right: 0; bottom: 0; width: min(440px, 100vw); background: var(--panel); border-left: 1px solid var(--line); box-shadow: -12px 0 32px rgba(15, 23, 32, .14); z-index: 81; display: flex; flex-direction: column; }
.asst-h { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); color: var(--brand-ink); }
.asst-h b { font-size: 15px; color: var(--text); }
.asst-b { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.asst-f { display: flex; gap: 8px; padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--panel-2); }
.asst-f .i { flex: 1; min-width: 0; }
.asst-load, .asst-empty { display: flex; align-items: center; gap: 8px; color: var(--muted); padding: 18px 4px; }
.asst-sum { background: var(--brand-soft); color: var(--text); border-radius: 12px; padding: 12px 14px; line-height: 1.55; font-size: 14px; }
.asst-sec { font-size: 11.5px; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin-top: 6px; }
.asst-card { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: var(--panel); display: flex; flex-direction: column; gap: 8px; transition: box-shadow .3s; }
.asst-card.urgent { border-left: 3px solid var(--red); }
.asst-card.prio { box-shadow: 0 0 0 2px var(--brand-soft); }
.asst-card.flash { box-shadow: 0 0 0 3px var(--brand); }
.asst-ch { display: flex; gap: 10px; align-items: flex-start; }
.asst-ic { width: 30px; height: 30px; border-radius: 8px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; flex: none; }
.asst-ic svg { width: 16px; height: 16px; }
.asst-t { font-weight: 600; font-size: 14px; line-height: 1.35; }
.asst-acts { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.asst-mail summary { cursor: pointer; font-size: 12.5px; color: var(--brand-ink); display: flex; align-items: center; gap: 6px; }
.asst-mail summary svg { width: 14px; height: 14px; }
.asst-mail .f { margin-top: 8px; }
.asst-mail textarea.i { font-size: 13px; line-height: 1.45; }
.asst-msg { border-radius: 12px; padding: 9px 12px; line-height: 1.5; font-size: 14px; max-width: 92%; }
.asst-msg.user { align-self: flex-end; background: var(--brand); color: #fff; }
.asst-msg.bot { align-self: flex-start; background: var(--panel-2); border: 1px solid var(--line); }
@media (max-width: 760px) { .asst { width: 100vw; border-left: 0; } }
.asst[hidden], .asst-bg[hidden] { display: none; }
/* assistant : carte « pièce à comptabiliser » avec l'écriture proposée, modifiable */
.asst { width: min(560px, 100vw); }
.asst-exp { display: flex; gap: 8px; font-size: 13px; line-height: 1.5; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.asst-exp svg { width: 15px; height: 15px; flex: none; margin-top: 2px; color: var(--brand); }
.asst-eh { gap: 8px; }
.asst-lines { display: flex; flex-direction: column; gap: 8px; }
.asst-line { display: grid; grid-template-columns: 1fr 1fr 1.2fr; gap: 6px 8px; padding: 8px; border: 1px dashed var(--line); border-radius: 10px; }
.asst-line .asst-vat { grid-column: 1 / 2; } .asst-line .asst-ll { grid-column: 2 / 4; }
.asst-line .asst-names { grid-column: 1 / -1; }
.asst-card.book .f { font-size: 12px; }
.asst-card.book .i { padding: 6px 8px; font-size: 13px; }
@media (max-width: 560px) { .asst-line { grid-template-columns: 1fr 1fr; } .asst-line .asst-vat, .asst-line .asst-ll { grid-column: 1 / -1; } .asst-eh { grid-template-columns: 1fr 1fr; } }
.flash-card { box-shadow: 0 0 0 3px var(--brand); transition: box-shadow .3s; }
/* assistant : validation groupée, sélection des écritures, brouillon de facture dans la conversation */
.asst-batch { display: flex; gap: 8px; flex-wrap: wrap; position: sticky; top: -14px; z-index: 2; background: var(--panel); padding: 6px 0; }
.asst-sel { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--brand-ink); font-weight: 600; }
.asst-draft { margin-top: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--text); display: flex; flex-direction: column; gap: 6px; }
.asst-draft.done { flex-direction: row; align-items: center; gap: 8px; }
.asst-draft .f { font-size: 12px; }
.asst-draft .i { padding: 6px 8px; font-size: 13px; }
.asst-dl { display: flex; flex-direction: column; gap: 5px; }
.asst-dline { display: grid; grid-template-columns: minmax(0, 1fr) 56px 64px 84px; gap: 5px; }
.asst-msg.bot { max-width: 100%; }
/* assistant en conversation : exemples de questions, réponses mises en forme */
.asst-ex { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.asst-chip { border: 1px solid var(--line); background: var(--panel); color: var(--brand-ink); border-radius: 999px; padding: 5px 10px; font: inherit; font-size: 12.5px; cursor: pointer; text-align: left; }
.asst-chip:hover { background: var(--panel-2); }
.asst-msg p { margin: 0 0 8px; } .asst-msg p:last-child { margin-bottom: 0; }
.asst-msg ul, .asst-msg ol { margin: 0 0 8px; padding-left: 20px; }
.asst-msg li { margin: 2px 0; }
.asst-msg .asst-card { margin-top: 8px; }
/* assistant : pièces lues, à cocher avant le « OK » */
.asst-pc { display: flex; gap: 8px; align-items: flex-start; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; line-height: 1.4; }
.asst-pc.warn { border-color: #f0c36d; background: #fff8e6; }
.asst-pc input { margin-top: 3px; }
/* assistant : micro (dictée de la question) */
.asst-mic { padding: 0 10px; }
.asst-mic.on { background: var(--red, #c0392b); border-color: var(--red, #c0392b); color: #fff; animation: asstpulse 1.2s infinite; }
@keyframes asstpulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(192, 57, 43, .45); } 50% { box-shadow: 0 0 0 6px rgba(192, 57, 43, 0); } }
/* salaires : choix du mois et de l'année */
.per-pick { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.per-pick select.i { width: auto; }

/* qui a créé / modifié l'élément */
.who-line{font-size:12px;color:var(--muted);margin:4px 0 10px;display:flex;align-items:center;gap:6px}
.who-line::before{content:'';width:7px;height:7px;border-radius:50%;background:var(--accent,#3b82f6);opacity:.6;flex:none}

/* ================= questionnaire d'ouverture de dossier ================= */
.qx { display: grid; grid-template-columns: 250px 1fr; gap: 20px; align-items: start; }
.qx-steps { position: sticky; top: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 8px; }
.qx-steps button { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: none; padding: 8px 10px; border-radius: 8px; cursor: pointer; text-align: left; color: var(--text-2); }
.qx-steps button:hover { background: var(--panel-2); }
.qx-steps button.on { background: var(--brand-soft); color: var(--brand-ink); font-weight: 600; }
.qx-steps .n { width: 23px; height: 23px; border-radius: 50%; background: var(--line-2); display: grid; place-items: center; font-size: 11.5px; font-weight: 700; flex: none; }
.qx-steps button.on .n { background: var(--brand); color: #fff; }
.qx-steps button.done .n { background: var(--green); color: #fff; }
.qx-hint { font-size: 12px; color: var(--muted); padding: 10px; border-top: 1px solid var(--line-2); margin-top: 6px; line-height: 1.45; }
.qx-req { color: var(--red); }
.qx-sec { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--brand-ink); font-weight: 700; margin: 18px 0 2px; padding-bottom: 6px; border-bottom: 1px solid var(--line-2); }
.qx .grid > .qx-sec:first-child, .qx-rep .grid > .qx-sec:first-child { margin-top: 0; }
.qx-l { font-size: 12.8px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.qx-seg { display: flex; gap: 6px; flex-wrap: wrap; }
.qx-seg label { border: 1px solid var(--line); border-radius: 8px; padding: 7px 11px; cursor: pointer; font-size: 13px; display: flex; gap: 7px; align-items: center; background: #fff; }
.qx-seg label:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-ink); }
.qx-seg input { accent-color: var(--brand); margin: 0; }
.qx-drop { border: 1.5px dashed #c5ced6; border-radius: 10px; padding: 12px; display: flex; align-items: center; gap: 11px; background: var(--panel-2); color: var(--muted); cursor: pointer; font-size: 13px; }
.qx-drop.over { border-color: var(--brand); background: var(--brand-soft); }
.qx-drop b { color: var(--text); }
.qx-files { display: flex; flex-direction: column; gap: 4px; margin-bottom: 6px; }
.qx-file { display: flex; align-items: center; gap: 8px; font-size: 13px; background: var(--brand-soft); border-radius: 7px; padding: 4px 6px 4px 9px; }
.qx-file a { display: inline-flex; gap: 6px; align-items: center; color: var(--brand-ink); font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.qx-file small { color: var(--muted); }
.qx-rep { border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-bottom: 12px; background: var(--panel-2); }
.qx-rep-h { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.qx-add { border-style: dashed; color: var(--brand-ink); }
.qx-nav { display: flex; gap: 10px; align-items: center; padding: 14px 20px; border-top: 1px solid var(--line-2); background: var(--panel-2); border-radius: 0 0 var(--r-lg) var(--r-lg); }
.qx-nav .grow { flex: 1; }
.qx-recap { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.qx-recap div { border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: #fff; color: var(--muted); }
.qx-recap b { display: block; font-size: 20px; color: var(--brand-ink); }
.qx-done { width: 56px; height: 56px; border-radius: 50%; background: var(--green-soft); color: var(--green); display: inline-grid; place-items: center; }
.qx-done svg.ic { width: 28px; height: 28px; }
.qx-plan td, .qx-plan th { font-size: 13px; }
.qx-top { margin-right: 6px; white-space: nowrap; }
@media (max-width: 900px) {
  .qx { grid-template-columns: 1fr; }
  .qx-steps { position: static; display: flex; overflow-x: auto; gap: 4px; }
  .qx-steps button { white-space: nowrap; width: auto; }
  .qx-hint { display: none; }
  .qx-recap { grid-template-columns: 1fr; }
  .qx-top span { display: none; }
}
.qx-plan { table-layout: fixed; } .qx-plan th:nth-child(2), .qx-plan th:nth-child(3) { width: 30%; } .qx-plan td { overflow-wrap: anywhere; }
.qx-rep-h .grow, .qx-nav .grow { flex: 1; } .qx .card-h { display: block; }

/* ================= courriers transmis à la fiduciaire ================= */
.cr-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 16px; align-items: start; }
.cr-body { white-space: pre-wrap; line-height: 1.55; background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 10px; padding: 12px 14px; font-size: 13.5px; }
@media (max-width: 1000px) { .cr-grid { grid-template-columns: 1fr; } }

/* partie Fiduciaire : en-tête à la place du choix de société */
.nav-fidu { display: flex; align-items: center; gap: 10px; margin: 4px 10px 12px; padding: 12px 14px; border-radius: 12px; background: rgba(255,255,255,.06); color: #fff; font-size: 15px; }
.nav-fidu svg.ic { color: var(--brand-3); }

.deposit-btn.deposit-mail { text-decoration: none; color: inherit; border-color: #a5f3fc; background: #f0fdff; }
.deposit-btn.deposit-mail svg.ic { color: #0e7490; }
.quick.quick-fidu { grid-template-columns: repeat(2, minmax(0,1fr)); } .quick.quick-fidu a { border-color: #a5f3fc; background: #f0fdff; } @media (max-width: 700px) { .quick.quick-fidu { grid-template-columns: 1fr; } }

.nav-back { display: flex; align-items: center; gap: 8px; margin: -4px 10px 10px; padding: 8px 12px; border-radius: 10px; color: var(--side-text); border: 1px solid rgba(255,255,255,.12); font-size: 13px; text-decoration: none; }
.nav-back:hover { background: rgba(255,255,255,.06); color: #fff; text-decoration: none; }

/* boîte mail de la fiduciaire */
.bx-state { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.bx-dot { width: 10px; height: 10px; border-radius: 50%; background: #c4cad1; flex: none; }
.bx-dot.on { background: #16a34a; box-shadow: 0 0 0 4px rgba(22,163,74,.15); }
.bx-dot.err { background: #dc2626; box-shadow: 0 0 0 4px rgba(220,38,38,.15); }
.bx-prev { max-width: 420px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bx-act { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.bx-act select.i.sm { padding: 5px 8px; font-size: 12.5px; height: auto; }
.bx-body { white-space: pre-wrap; background: #f8f9fb; border: 1px solid var(--line, #e5e7eb); border-radius: 10px; padding: 14px 16px; font-size: 13.5px; line-height: 1.55; max-height: 46vh; overflow: auto; }
.bx-t .svg-ic, .bx-t svg.ic { vertical-align: -2px; }

/* pastille sur le bouton Fiduciaire */
.suivi-btn { position: relative; }
.suivi-btn .dot { position: absolute; top: -3px; right: -3px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--red); color: #fff; font-size: 10.5px; font-weight: 700; line-height: 17px; text-align: center; }
/* archives des dossiers */
.ar-search { position: relative; display: flex; align-items: center; gap: 8px; }
.ar-search svg.ic { position: absolute; left: 11px; color: var(--muted); pointer-events: none; }
.ar-search input { padding-left: 34px; font-size: 15px; }
.ar-list { margin-top: 6px; border: 1px solid var(--line, #e5e7eb); border-radius: 10px; max-height: 320px; overflow: auto; background: #fff; }
.ar-list button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border: 0; background: none; text-align: left; font-size: 14px; cursor: pointer; }
.ar-list button:hover { background: var(--brand-soft, #eef6f7); }
.ar-list button small { margin-left: auto; color: var(--muted); }
.ar-t td { vertical-align: top; }
.ar-ic { display: inline-flex; margin-right: 8px; color: var(--brand, #2f7f8c); vertical-align: -3px; }
.ar-sub { margin-left: 26px; }
.ar-files { display: flex; flex-wrap: wrap; gap: 6px 12px; margin: 4px 0 0 26px; font-size: 12.5px; }
.ar-files a { display: inline-flex; align-items: center; gap: 4px; }

/* boîte mail : écrire aux clients */
.bx-rcp { max-height: 210px; overflow: auto; border: 1px solid var(--line, #e5e7eb); border-radius: 10px; }
.bx-rcp label { display: grid; grid-template-columns: 22px 1fr; column-gap: 6px; padding: 7px 10px; border-bottom: 1px solid var(--line, #eef0f2); cursor: pointer; font-size: 13.5px; }
.bx-rcp label small { grid-column: 2; color: var(--muted); font-size: 12px; }
.bx-rcp label.off { opacity: .55; cursor: default; }
.bx-shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.bx-shots label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; cursor: pointer; }
.bx-shots img { width: 100%; height: 92px; object-fit: cover; object-position: top left; border: 1px solid var(--line, #e5e7eb); border-radius: 8px; }
.bx-shots input { position: absolute; margin: 6px; }
.bx-shots label { position: relative; }

/* lecture d'un e-mail (boîte mail) : présentation d'une vraie messagerie */
.ml-head { display: flex; gap: 12px; align-items: flex-start; }
.ml-av { flex: none; width: 40px; height: 40px; border-radius: 50%; background: var(--brand-soft, #e6f2f4); color: var(--brand-ink, #0e4650); display: grid; place-items: center; font-weight: 700; font-size: 14px; }
.ml-who { flex: 1; min-width: 0; }
.ml-l1 { display: flex; gap: 8px; align-items: baseline; justify-content: space-between; }
.ml-l1 b { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ml-date { flex: none; font-size: 12px; color: var(--muted); }
.ml-addr { font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
.ml-subj { font-size: 18px; line-height: 1.3; margin: 16px 0 12px; font-weight: 650; }
.ml-text { white-space: pre-wrap; font-size: 15px; line-height: 1.55; color: var(--text); overflow-wrap: anywhere; }
.ml-files { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.ml-file { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--line, #e5e7eb); border-radius: 10px; color: var(--text); text-decoration: none !important; max-width: 100%; }
.ml-file svg.ic { width: 18px; height: 18px; color: var(--brand); }
.ml-file span { display: flex; flex-direction: column; min-width: 0; } .ml-file b { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .ml-file small { font-size: 11.5px; color: var(--muted); }
.ml-file.off { opacity: .55; }
.ml-meta { margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--line-2, #eef0f2); display: flex; flex-direction: column; gap: 6px; color: var(--text-2); }
.ml-meta svg.ic { width: 14px; height: 14px; vertical-align: -2px; }
.ml-read .modal-h h2 { font-size: 15px; color: var(--muted); font-weight: 600; }

/* tirer pour actualiser (téléphone) */
.ptr { position: fixed; z-index: 95; left: 50%; top: calc(62px + env(safe-area-inset-top)); width: 38px; height: 38px; margin-left: -19px; border-radius: 50%; background: #fff; box-shadow: 0 4px 14px rgba(16,24,40,.18); display: grid; place-items: center; color: var(--brand); opacity: 0; pointer-events: none; transform: translateY(-40px); transition: opacity .15s; }
.ptr svg.ic { width: 18px; height: 18px; } .ptr.on { color: #fff; background: var(--brand); } .ptr.spin svg { animation: spin .8s linear infinite; }

@media (max-width: 760px) {
  /* actualiser visible dans la barre du haut */
  .topbar #refresh-btn { display: grid !important; }
  /* boîte mail : une ligne par e-mail, comme l'app Mail (expéditeur + date, objet, aperçu, dossier, actions) */
  table.t.bx-t tr { grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; padding: 12px 14px; }
  table.t.bx-t td::before { display: none !important; }
  table.t.bx-t td:nth-child(2) { grid-column: 1; grid-row: 1; font-size: 15px; } table.t.bx-t td:nth-child(2) .small { display: none; }
  table.t.bx-t td:nth-child(1) { grid-column: 2; grid-row: 1; text-align: right; font-size: 12px; color: var(--muted); white-space: nowrap; }
  table.t.bx-t td:nth-child(3) { grid-column: 1 / -1; grid-row: 2; font-size: 14px; }
  table.t.bx-t td:nth-child(3) .bx-prev { max-width: none; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  table.t.bx-t td:nth-child(4) { grid-column: 1 / -1; grid-row: 3; margin-top: 4px; display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; } table.t.bx-t td:nth-child(4) > div { margin: 0 !important; }
  table.t.bx-t td:nth-child(5) { grid-column: 1 / -1; grid-row: 4; text-align: left !important; margin-top: 6px; }
  table.t.bx-t td:nth-child(5) .bx-act { justify-content: flex-start; } table.t.bx-t td:nth-child(5) select.i { flex: 1 1 100%; }
  table.t.bx-t svg.ic { width: 14px; height: 14px; }
  /* archives : date + bouton en haut, contenu en dessous */
  table.t.ar-t tr { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; padding: 12px 14px; }
  table.t.ar-t td::before { display: none !important; }
  table.t.ar-t td:nth-child(1) { grid-column: 1; grid-row: 1; font-size: 12px; color: var(--muted); align-self: center; }
  table.t.ar-t td:nth-child(3) { grid-column: 2; grid-row: 1; text-align: right !important; } table.t.ar-t td:nth-child(3) .btn { padding: 4px 10px; }
  table.t.ar-t td:nth-child(2) { grid-column: 1 / -1; grid-row: 2; font-size: 14px; }
  .ar-sub, .ar-files { margin-left: 0; } .ar-ic svg.ic { width: 15px; height: 15px; }
  /* lecture d'un e-mail : plein écran */
  .modal.ml-read { max-height: calc(100dvh - 24px - env(safe-area-inset-top)); }
  .ml-subj { font-size: 17px; }
}
@media (max-width: 760px) { #ar-f { max-width: none !important; flex: 1 1 100%; width: 100%; } #ar-y { flex: 1 1 100%; width: 100% !important; } #ar-body .toolbar > span[style*="flex:1"] { display: none; } }

/* ================= boîte mail type Outlook : dossiers | liste | lecture ================= */
.mbx { display: grid; grid-template-columns: 210px minmax(300px, 400px) minmax(0, 1fr); height: 100%; background: #fff; border-top: 1px solid var(--line, #e5e7eb); }
.mbx-f { border-right: 1px solid var(--line, #e5e7eb); padding: 12px 10px; display: flex; flex-direction: column; gap: 10px; background: var(--panel-2, #f8f9fb); min-height: 0; overflow: auto; }
.mbx-new { justify-content: center; width: 100%; }
.mbx-fl { display: flex; flex-direction: column; gap: 1px; }
.mbx-fl a { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 8px; color: var(--text-2); text-decoration: none !important; font-size: 13.5px; font-weight: 550; }
.mbx-fl a:hover { background: rgba(0,0,0,.04); }
.mbx-fl a.on { background: var(--brand-soft, #e6f2f4); color: var(--brand-ink, #0e4650); }
.mbx-fl a span { flex: 1; } .mbx-fl a b { font-size: 11.5px; min-width: 20px; text-align: center; padding: 1px 6px; border-radius: 9px; background: rgba(0,0,0,.07); }
.mbx-fl a b.warn { background: var(--amber, #f59e0b); color: #fff; } .mbx-fl a b.red { background: var(--red); color: #fff; } .mbx-fl a.late { color: var(--red); }
.mbx-fl svg.ic { width: 16px; height: 16px; }
.mbx-status { margin-top: auto; font-size: 12px; color: var(--muted); display: flex; flex-direction: column; gap: 6px; }
.mbx-st { display: flex; gap: 7px; align-items: center; } .mbx-st.warn { color: var(--red); align-items: flex-start; } .mbx-st svg.ic { width: 14px; height: 14px; flex: none; }
.mbx-stb { display: flex; gap: 6px; flex-wrap: wrap; } .mbx-addr { font-size: 11.5px; overflow-wrap: anywhere; }
.mbx-l { border-right: 1px solid var(--line, #e5e7eb); display: flex; flex-direction: column; min-height: 0; }
.mbx-lh { padding: 12px 12px 10px; border-bottom: 1px solid var(--line, #e5e7eb); display: flex; flex-direction: column; gap: 8px; }
.mbx-lh > b { font-size: 16px; }
.mbx-search { position: relative; } .mbx-search svg.ic { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--muted); } .mbx-search input { padding-left: 32px; height: 34px; }
.mbx-rows { overflow: auto; flex: 1; }
.mbx-row { display: flex; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line-2, #eef0f2); cursor: pointer; border-left: 3px solid transparent; }
.mbx-row:hover { background: #f6f8fa; } .mbx-row.sel { background: var(--brand-soft, #e6f2f4); border-left-color: var(--brand, #2f7f8c); }
.mbx-av { flex: none; width: 34px; height: 34px; border-radius: 50%; background: #e8edf2; color: #3b4b5c; display: grid; place-items: center; font-size: 12px; font-weight: 700; } .mbx-av svg.ic { width: 15px; height: 15px; }
.mbx-row.open .mbx-av { background: var(--brand, #2f7f8c); color: #fff; }
.mbx-rc { flex: 1; min-width: 0; }
.mbx-r1 { display: flex; justify-content: space-between; gap: 8px; } .mbx-r1 b { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; } .mbx-row.open .mbx-r1 b { font-weight: 750; }
.mbx-r1 span { flex: none; font-size: 11.5px; color: var(--muted); }
.mbx-r2 { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .mbx-row.open .mbx-r2 { font-weight: 650; color: var(--brand-ink, #0e4650); }
.mbx-r2 svg.ic { width: 13px; height: 13px; vertical-align: -2px; color: var(--muted); } .mbx-rep svg.ic { color: var(--brand); }
.mbx-r3 { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mbx-r4 { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.mbx-tag { font-size: 11px; padding: 1px 7px; border-radius: 6px; background: #eef1f4; color: #3b4b5c; } .mbx-tag.dim { color: var(--muted); }
.mbx-tag.violet { background: #efeafe; color: #5b3fc4; } .mbx-tag.green { background: #e7f6ec; color: #17803d; } .mbx-tag.amber { background: #fff4dc; color: #92400e; } .mbx-tag.grey { background: #eef1f4; color: #6b7280; } .mbx-tag.teal { background: #e0f5f3; color: #0f766e; } .mbx-tag.red { background: #fde8e8; color: #b42318; }
.mbx-r { display: flex; flex-direction: column; min-height: 0; overflow: auto; }
.mbx-tb { position: sticky; top: 0; z-index: 2; background: #fff; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--line, #e5e7eb); }
.mbx-sep { width: 1px; height: 22px; background: var(--line, #e5e7eb); margin: 0 2px; }
.mbx-back { display: none; }
.mbx-mail { padding: 14px 22px 28px; max-width: 860px; }
.mbx-mail .ml-meta select.i { display: inline-block; width: auto; min-width: 200px; margin-left: 4px; padding: 4px 8px; height: auto; font-size: 13px; }
.mbx-empty { margin: auto; padding: 40px 20px; display: flex; flex-direction: column; align-items: center; gap: 10px; color: var(--muted); font-size: 13.5px; text-align: center; } .mbx-empty svg.ic { width: 34px; height: 34px; opacity: .5; }
@media (max-width: 1100px) { .mbx { grid-template-columns: 180px minmax(260px, 340px) minmax(0, 1fr); } }
@media (max-width: 760px) {
  /* téléphone : dossiers en bandeau, liste ; un e-mail ouvert prend tout l'écran */
  .mbx { display: flex; flex-direction: column; height: auto; min-height: calc(100dvh - 56px - 76px); border-top: 0; }
  .mbx-f { flex-direction: row; align-items: center; gap: 8px; padding: 8px 10px; border-right: 0; border-bottom: 1px solid var(--line, #e5e7eb); overflow-x: auto; position: sticky; top: 0; z-index: 3; }
  .mbx-new { width: auto; flex: none; padding: 0 10px; } .mbx-new span { display: none; }
  .mbx-fl { flex-direction: row; gap: 4px; } .mbx-fl a { white-space: nowrap; padding: 7px 10px; background: #fff; border: 1px solid var(--line, #e5e7eb); } .mbx-fl a.on { border-color: transparent; }
  .mbx-status { display: none; }
  .mbx-l { border-right: 0; } .mbx-rows { overflow: visible; }
  .mbx-r { display: none; }
  .mbx.reading .mbx-f, .mbx.reading .mbx-l { display: none; }
  .mbx.reading .mbx-r { display: flex; overflow: visible; }
  .mbx-back { display: inline-flex; margin-right: auto; } .mbx-tb { top: 0; padding: 8px 12px; } .mbx-tb .btn.sm { padding: 6px 9px; }
  .mbx-sep { display: none; }
  .mbx-mail { padding: 12px 16px 24px; } .mbx-mail .ml-meta select.i { width: 100%; margin: 6px 0 0; }
}

/* barre du bas (téléphone) : pastille sur « Mails » */
.tabbar a { position: relative; } .tabbar .tab-cnt { position: absolute; top: 2px; left: calc(50% + 6px); min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--red); color: #fff; font-size: 10px; font-weight: 700; line-height: 17px; text-align: center; }

/* ---- téléphone : finitions (audit) ---- */
@media (max-width: 760px) {
  .topbar #nav-back:disabled, .topbar #nav-fwd { display: none; }
  .topbar .crumb { font-weight: 650; font-size: 15px; }
  .chart { height: auto; }
  .chart text { font-size: 12px; }
  /* fiche : le nom (client, n°) est le titre de la fiche, sans intitulé au-dessus */
  table.t td:has(.who)::before, table.t:not(.docs) tbody td:first-child:has(b, strong, .strong)::before { display: none !important; }
  /* bandes défilantes sans barre de défilement visible */
  .mbx-f, .tabs, .snav, .mbx-tb { scrollbar-width: none; } .mbx-f::-webkit-scrollbar, .tabs::-webkit-scrollbar, .snav::-webkit-scrollbar, .mbx-tb::-webkit-scrollbar { display: none; }
  /* lecture d'un e-mail : actions sur une ligne défilante, comme une messagerie */
  .mbx-tb { flex-wrap: nowrap; overflow-x: auto; gap: 6px; }
  .mbx-tb > * { flex: none; }
  .mbx-row { padding: 12px 14px; }
  .mbx-r1 b { font-size: 14.5px; } .mbx-r2 { font-size: 14px; } .mbx-r3 { font-size: 13px; }
  /* boutons et cases : zone de toucher confortable */
  .btn { min-height: 38px; }
  .btn.sm { min-height: 34px; }
  .icon-btn { min-width: 34px; min-height: 34px; }
  .page-h h1 { font-size: 22px; }
}
/* téléphone : la Fiduciaire s'arrête au-dessus de la barre d'onglets du bas (boutons des fenêtres et fin des listes visibles) */
@media (max-width: 760px) { .main:has(> .suivi-frame) { padding-bottom: calc(58px + env(safe-area-inset-bottom)) !important; } }
/* téléphone : pièces déposées — statut sous le nom, bouton « retirer » aligné à droite */
@media (max-width: 760px) { .list .it.inbox-it { align-items: center; row-gap: 6px; } .list .it.inbox-it > .badge { margin-left: 44px; } .list .it.inbox-it > button.keep:last-child { margin-left: auto; } }
/* téléphone : une ligne longue (note, nom, libellé) ne doit jamais élargir la page */
@media (max-width: 760px) {
  .grid.g2, .grid.g3, .grid.g4, .g2, .g3, .g4, .dash, .dash.bilan-cols, .ob-cols, .scan, .settings, .editor { grid-template-columns: minmax(0, 1fr) !important; }
  .kpis, .quick, .balance, .emp-info, .split-line, .afc-screen .afc-info { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important; }
  .card, .card-b, .content, .page-h > div, .list .it .grow { min-width: 0; max-width: 100%; }
  .content, .card-b, .list .it .grow { overflow-wrap: break-word; }
}
@media (max-width: 760px) {
  .page-h h1, .page-h .lead, .card-h h3, .card-h .sub { overflow-wrap: break-word; }
  .card-h h3 { white-space: normal; min-width: 0; }
  .badge, .tag, .chip, .mbx-tag { white-space: normal; max-width: 100%; overflow-wrap: break-word; min-width: 0; }
  .badge::before { flex: none; }
  .toolbar, .acts, .page-h .acts { flex-wrap: wrap; min-width: 0; }
  table.t.fin td, table.t.fin th { white-space: normal; overflow-wrap: break-word; }
  table.t.fin td.num, table.t.fin th.num { white-space: nowrap; }
}
/* téléphone : un bouton (nom de fichier long, libellé long) ne dépasse jamais l'écran, son texte passe à la ligne */
@media (max-width: 760px) {
  .btn { max-width: 100%; min-width: 0; white-space: normal; height: auto; text-align: left; overflow-wrap: break-word; line-height: 1.3; padding-top: 7px; padding-bottom: 7px; }
  .btn svg.ic { flex: none; }
  .page-h > div[style*="min-width"] { min-width: 0 !important; }
  .content, .card-b { overflow-wrap: break-word; }
}
/* téléphone : décompte TVA (formulaire AFC) — libellé sur toute la largeur, chiffre / montants / taux en dessous */
@media (max-width: 760px) {
  .afc-screen table, .afc-screen thead, .afc-screen tbody, .afc-screen tfoot { display: block; width: 100%; }
  .afc-screen tr { display: grid; grid-template-columns: 40px minmax(0, 1fr) minmax(0, 1fr) auto; column-gap: 8px; row-gap: 4px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line-2); }
  .afc-screen tr > :first-child { grid-column: 1 / -1; }
  .afc-screen tr > [colspan] { grid-column: 1 / -1; }
  .afc-screen td, .afc-screen th { display: block; width: auto !important; padding: 0 !important; border: 0 !important; min-width: 0; }
  .afc-screen td:first-child { font-size: 13px !important; line-height: 1.4; }
  .afc-screen .bx { width: auto !important; }
  .afc-screen .bx input, .afc-screen .bx .i { width: 100%; min-width: 0; }
  .afc-screen .rate { white-space: nowrap; text-align: right; }
}
/* téléphone : fiche employé, toutes les rubriques visibles (grille 2 colonnes, titres de groupe sur toute la largeur) */
@media (max-width: 760px) {
  .emp-nav { display: grid !important; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); overflow: visible !important; padding: 6px; gap: 4px; }
  .emp-nav-sec { display: block !important; grid-column: 1 / -1; padding: 6px 6px 2px !important; }
  .emp-nav button { width: 100% !important; white-space: normal !important; flex: initial !important; padding: 8px; font-size: 13px; line-height: 1.25; align-items: center; }
  .emp-nav button .badge { white-space: nowrap; }
}
/* téléphone : plus d'onglets cachés hors de l'écran — onglets, rubriques des réglages et dossiers de la boîte passent à la ligne */
@media (max-width: 760px) {
  .tabs { display: flex !important; flex-wrap: wrap !important; overflow: visible !important; max-width: 100%; }
  .tabs button { white-space: normal !important; flex: 1 1 auto; justify-content: center; text-align: center; line-height: 1.25; }
  .snav { display: grid !important; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 4px; overflow: visible !important; margin: 0 !important; padding: 0 !important; }
  .snav button { white-space: normal !important; flex: initial !important; min-width: 0; padding: 8px 10px; font-size: 13px; line-height: 1.25; border: 1px solid var(--line); background: var(--panel, #fff); }
  .snav button.on { border-color: var(--brand); }
  .mbx-f { flex-wrap: nowrap; overflow: visible !important; align-items: stretch; }
  .mbx-fl { display: grid !important; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); flex: 1; min-width: 0; }
  .mbx-fl a { white-space: normal !important; min-width: 0; line-height: 1.25; }
  .mbx-new { align-self: stretch; height: auto; }
}
/* téléphone : tableau dans un encadré (ex. taux légaux des salaires) tenu dans la largeur */
@media (max-width: 760px) {
  .notice > .grow, .notice > div { min-width: 0; }
  .notice table.t { width: 100%; max-width: 100%; min-width: 0 !important; }
  table.t td::before { white-space: normal; }
}
/* téléphone : titre de page sur toute la largeur, boutons dessous (le texte n'est plus serré à gauche d'un bouton) */
@media (max-width: 760px) {
  .page-h > div[style*="flex:1"] { flex: 1 1 100% !important; }
  /* onglets : grille régulière de 2 colonnes */
  .tabs { display: grid !important; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); width: 100%; }
  .tabs button { justify-content: center; padding: 8px 8px; }
  /* décompte TVA : l'en-tête de colonnes n'a plus de sens une fois en fiches */
  .afc-screen thead { display: none !important; }
}
/* iPhone, application installée (iOS 26) : l'écran est calculé trop court de la hauteur de la barre d'état,
   d'où une bande vide sous la barre du bas ; la page est rallongée d'autant (sans effet ailleurs) */
@media (display-mode: standalone) and (max-width: 760px) and (pointer: coarse) {
  html { min-height: min(100lvh, calc(100% + env(safe-area-inset-top))); }
}
.pv-hint { display: none; }
@media (max-width: 760px) { .pv-hint { display: block; margin-top: 8px; font-size: 12.5px; color: var(--muted); text-align: center; } .slip-preview { height: calc(100dvh - 280px); min-height: 320px; } }
/* téléphone : une fenêtre ne glisse jamais de côté en faisant défiler (iPhone) */
@media (max-width: 760px) { .modal-b { overflow-x: hidden; overscroll-behavior: contain; } }
/* écran tactile : liste de suggestions (comptes, fournisseurs, libellés…) */
.ac-box { position: fixed; z-index: 400; background: var(--panel, #fff); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.18); overflow-y: auto; overscroll-behavior: contain; padding: 4px; }
.ac-it { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 11px 10px; font: inherit; font-size: 15px; color: var(--text); border-radius: 7px; border-bottom: 1px solid var(--line-2, #eef0f3); }
.ac-it:last-child { border-bottom: 0; }
.ac-it:active { background: var(--brand-soft, #e6f2f4); }
/* lignes filtrées par une recherche : masquées aussi en affichage « fiches » (téléphone) */
table tr[hidden] { display: none !important; }
/* téléphone : la recherche d'une barre d'outils prend toute la ligne */
@media (max-width: 760px) { .toolbar > .search { flex: 1 1 100% !important; } }
/* écriture sans justificatif : bouton « Joindre » */
.attach-add { display: inline-flex; align-items: center; gap: 4px; margin-left: 6px; padding: 1px 8px; border: 1px dashed var(--line, #d5dbe1); border-radius: 999px; background: none; color: var(--muted); font: inherit; font-size: 11.5px; cursor: pointer; vertical-align: middle; white-space: nowrap; }
.attach-add svg { width: 12px; height: 12px; }
.attach-add:hover { border-color: var(--brand); color: var(--brand-ink, var(--brand)); background: var(--brand-soft, #e6f2f4); }
/* salaires : compte salaire (présentation du compte salaire suisse : codes GS, mois en colonnes) */
.ct-card { padding: 0; overflow: hidden; }
.ct-screen { padding: 18px 20px 6px; }
.ct-head { display: grid; grid-template-columns: 1.2fr 1.5fr 1.1fr 1fr; gap: 18px; align-items: start; margin-bottom: 10px; }
.ct-title { font-size: 20px; font-weight: 700; } .ct-who { font-size: 15px; font-weight: 700; margin-top: 14px; }
.ct-kv { font-size: 12.5px; line-height: 1.8; } .ct-kv span { color: var(--muted); }
.ct-co { font-size: 12.5px; line-height: 1.55; } .ct-date { margin-top: 6px; color: var(--muted); }
.ct-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.ct-tbl { width: 100%; min-width: 1180px; border-collapse: separate; border-spacing: 0; font-size: 12.5px; }
.ct-tbl th, .ct-tbl td { padding: 6px 8px; border-bottom: 1px solid var(--line-2, #eef0f3); background: var(--panel, #fff); vertical-align: top; }
.ct-tbl th { font-weight: 700; text-align: left; border-bottom: 2px solid var(--text, #111); white-space: nowrap; }
.ct-tbl th.num, .ct-tbl td.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ct-tbl td.gs { color: var(--muted); width: 44px; }
.ct-tbl td:nth-child(2), .ct-tbl th:nth-child(2) { position: sticky; left: 0; z-index: 1; min-width: 200px; max-width: 240px; box-shadow: 1px 0 0 var(--line, #e5e7eb); }
.ct-tbl tr.tot td { font-weight: 700; }
@media (max-width: 760px) {
  .ct-head { grid-template-columns: 1fr 1fr; gap: 10px 14px; } .ct-title { font-size: 18px; margin: 0; } .ct-who { margin-top: 4px; }
  .ct-screen { padding: 14px 14px 4px; } .ct-tbl { min-width: 1080px; font-size: 12px; } .ct-tbl td.gs, .ct-tbl th:first-child { display: none; }
  .ct-tbl td:nth-child(2), .ct-tbl th:nth-child(2) { min-width: 150px; max-width: 170px; }
}
/* un élément masqué (attribut hidden) reste masqué, même s'il a une classe qui l'affiche (ex. bouton .btn) */
[hidden] { display: none !important; }

/* abonnement au logiciel */
.planbar { background: #fff7e6; color: #7a4b00; border-bottom-color: #f1dcb0; }
.planbar > svg.ic { color: #b7791f; } .planbar b { color: #5c3a00; }
.planbar .btn { color: #7a4b00; border-color: rgba(122,75,0,.3); } .planbar .btn:hover { background: rgba(122,75,0,.08); color: #5c3a00; }
.planbar.ro { background: #fdecec; color: #8a1f1f; border-bottom-color: #f3c9c9; } .planbar.ro b { color: #6e1414; } .planbar.ro > svg.ic { color: #c53030; }
.planbar .btn.primary { background: var(--brand); color: #fff; border-color: transparent; }
.plan-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 16px; margin: 14px 0; }
.plan-mod { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line-2); cursor: pointer; }
.plan-mod:first-child { border-top: 0; padding-top: 0; }
.plan-mod input { width: 18px; height: 18px; flex: none; }
.plan-mod .ico { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); flex: none; }
.plan-mod small { display: block; color: var(--muted); font-size: 12.5px; }
.plan-emp { display: flex; align-items: center; gap: 10px; padding: 4px 0 12px 46px; font-size: 13px; }
.plan-emp .i { width: 90px; }
.seg { display: inline-flex; gap: 4px; padding: 3px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line); margin-bottom: 14px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 7px 12px; border-radius: 8px; font: inherit; font-size: 13px; color: var(--muted); cursor: pointer; }
.seg button.on { background: var(--panel); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.08); font-weight: 600; }
.plan-name { font-weight: 600; }
.plan-price { font-size: 30px; font-weight: 700; margin: 4px 0; letter-spacing: -.01em; }
.plan-price span { font-size: 13px; font-weight: 400; color: var(--muted); }
.plan-save { color: var(--green); font-size: 13px; display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.plan-acts { display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0 10px; }
@media (max-width: 760px) { .plan-grid { grid-template-columns: 1fr; } .plan-emp { padding-left: 0; } .planbar { padding: 8px 14px; flex-wrap: wrap; } }

/* verrouillage de l'application : code à 4 chiffres ou Face ID */
html.lk-on body > *:not(#lockscr) { visibility: hidden; }
#lockscr { position: fixed; inset: 0; z-index: 100000; display: flex; align-items: center; justify-content: center; padding: max(24px, env(safe-area-inset-top)) 20px max(24px, env(safe-area-inset-bottom)); background: linear-gradient(160deg, #0f2a33, #134e5e 60%, #1b6f7a); color: #fff; overflow: auto; }
#lockscr .lk-box { width: 100%; max-width: 330px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
#lockscr .lk-logo { height: 34px; margin-bottom: 14px; }
#lockscr h2 { margin: 0; font-size: 22px; font-weight: 650; color: #fff; }
#lockscr p { margin: 0 0 8px; font-size: 14px; line-height: 1.45; color: rgba(255,255,255,.78); }
#lockscr .lk-dots { display: flex; gap: 16px; margin: 10px 0 2px; }
#lockscr .lk-dots i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgba(255,255,255,.85); transition: background .12s; }
#lockscr .lk-dots i.on { background: #fff; }
#lockscr .lk-dots.shake { animation: lkShake .4s; }
@keyframes lkShake { 20%, 60% { transform: translateX(-9px); } 40%, 80% { transform: translateX(9px); } }
#lockscr .lk-msg { min-height: 20px; font-size: 13px; color: #fecaca; }
#lockscr .lk-pad { display: grid; grid-template-columns: repeat(3, 72px); gap: 14px 22px; margin: 4px 0 10px; }
#lockscr .lk-pad button { width: 72px; height: 72px; border-radius: 50%; border: 0; background: rgba(255,255,255,.13); color: #fff; font-size: 27px; font-weight: 500; cursor: pointer; -webkit-tap-highlight-color: transparent; }
#lockscr .lk-pad button:active { background: rgba(255,255,255,.32); }
#lockscr .lk-btn { width: 100%; padding: 13px 16px; border-radius: 12px; border: 0; background: #fff; color: #134e5e; font-size: 15px; font-weight: 650; cursor: pointer; }
#lockscr .lk-btn.ghost { background: rgba(255,255,255,.14); color: #fff; }
#lockscr .lk-link { margin-top: 4px; background: none; border: 0; color: rgba(255,255,255,.8); font-size: 14px; text-decoration: underline; cursor: pointer; padding: 8px; }

/* Sociétés et comptes : réglages en tuiles, tableaux plus aérés */
.set-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.set-tile { background: var(--card, #fff); border: 1px solid var(--line, #e5e7eb); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; min-width: 0; }
.set-tile.on { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.set-tile .st-h { display: flex; gap: 8px; align-items: center; font-size: 14.5px; }
.set-tile .st-h svg { width: 18px; height: 18px; color: var(--brand); }
.set-tile .st-l { font-size: 12.8px; color: var(--muted); line-height: 1.45; overflow-wrap: anywhere; flex: 1; }
.set-panel { margin-bottom: 16px; }
.set-panel > .card { margin-bottom: 0; }
.adm-q { position: relative; display: flex; align-items: center; min-width: 220px; }
.adm-q svg { position: absolute; left: 10px; width: 15px; height: 15px; color: var(--muted); pointer-events: none; }
.adm-q .i { padding-left: 32px; height: 34px; }
.adm-t .t td { padding-top: 12px; padding-bottom: 12px; }
.adm-t .t tbody tr.click:hover { background: var(--brand-soft, rgba(20, 120, 130, .06)); }
.adm-t .t th { font-size: 11.5px; letter-spacing: .03em; text-transform: uppercase; color: var(--muted); }
@media (max-width: 900px) { .set-tiles { grid-template-columns: 1fr; } .adm-q { min-width: 0; flex: 1; } }

/* Comptabilité → Analyse financière : ratios et normes du domaine */
.an-h { font-size: 13px; font-weight: 650; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 18px 0 8px; }
.an-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 12px; }
.an-card { background: var(--card, #fff); border: 1px solid var(--line, #e5e7eb); border-left: 4px solid var(--line, #e5e7eb); border-radius: 0; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.an-card.ok { border-left-color: var(--green, #16a34a); } .an-card.warn { border-left-color: var(--amber, #d97706); } .an-card.bad { border-left-color: var(--red, #dc2626); }
.an-l { font-size: 12.8px; color: var(--muted); cursor: help; }
.an-v { font-size: 22px; font-weight: 650; line-height: 1.2; }
.an-s { font-size: 12px; color: var(--muted); min-height: 16px; }
.an-f { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 4px; }
