/* Kiraa — design simple : barre latérale, tableaux, fenêtres à onglets. Propriétés logiques (arabe = droite à gauche). */
@font-face { font-family: Inter; src: url('/vendor/fonts/Inter-latin.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'Noto Sans Arabic'; src: url('/vendor/fonts/NotoSansArabic-400.woff2') format('woff2'); font-weight: 400; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: 'Noto Sans Arabic'; src: url('/vendor/fonts/NotoSansArabic-700.woff2') format('woff2'); font-weight: 700; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF; }
:root {
  --bg: #f2f5f6; --card: #fff; --ink: #15232c; --ink2: #4d5b64; --ink3: #7a868e; --line: #e2e7ea; --soft: #f6f8f9;
  --pri: #0f7c80; --pri2: #0b6468; --pri-soft: #e3f2f2; --side: #0f3c42; --side2: #164c53; --side-ink: #cfe3e4;
  --good: #1e8a4c; --good-bg: #e4f5ea; --warn: #a3620a; --warn-bg: #fdf1dc; --bad: #c0362c; --bad-bg: #fde8e6; --info: #2563a8; --info-bg: #e5eefa; --mute-bg: #eef1f3;
  --r: 10px; --shadow: 0 1px 2px rgba(16, 40, 50, .06), 0 2px 10px rgba(16, 40, 50, .05);
  --font: Inter, 'Noto Sans Arabic', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.45 var(--font); color: var(--ink); background: var(--bg); }
[dir=rtl] body { font-size: 15.5px; }
a { color: var(--pri); text-decoration: none; } a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.25; }
.i { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
[dir=rtl] .i.flip, [dir=rtl] .back .i, [dir=rtl] .alert > .i:last-child, [dir=rtl] .more .i { transform: scaleX(-1); }
.muted { color: var(--ink3); } .pos { color: var(--good); } .neg { color: var(--bad); } .big { font-size: 1.25em; }
.sub { display: block; font-size: 12.5px; color: var(--ink3); font-weight: 400; margin-top: 1px; }
.hidden, [hidden] { display: none !important; }

/* ---------- Coquille ---------- */
#app { min-height: 100vh; }
.side { position: fixed; inset-block: 0; inset-inline-start: 0; width: 232px; background: var(--side); color: var(--side-ink); display: flex; flex-direction: column; z-index: 30; }
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 14px; color: #fff; font-weight: 700; font-size: 20px; letter-spacing: .2px; }
.brand:hover { text-decoration: none; }
.brand.big { color: var(--ink); padding: 0; font-size: 24px; }
.nav { display: flex; flex-direction: column; padding: 6px 10px; gap: 2px; overflow-y: auto; flex: 1; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 8px; color: var(--side-ink); font-weight: 500; }
.nav a:hover { background: var(--side2); text-decoration: none; color: #fff; }
.nav a.on { background: #fff; color: var(--side); font-weight: 600; }
.nav .badge { margin-inline-start: auto; background: var(--bad); color: #fff; border-radius: 10px; font-size: 11.5px; padding: 1px 7px; font-weight: 700; }
.sidefoot { padding: 12px 14px; border-top: 1px solid var(--side2); display: flex; flex-direction: column; gap: 6px; }
.sidefoot .who { font-size: 12.5px; opacity: .8; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidefoot .btn { color: var(--side-ink); justify-content: flex-start; padding-inline: 0; }
.main { margin-inline-start: 232px; min-height: 100vh; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 20; background: rgba(242, 245, 246, .92); backdrop-filter: blur(6px); display: flex; align-items: center; gap: 12px; padding: 18px 28px 12px; }
.top h1 { font-size: 22px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top .actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.top .burger { display: none; }
.page { padding: 4px 28px 60px; max-width: 1240px; width: 100%; }
.scrim { display: none; }
.boot { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; color: var(--ink2); }

/* ---------- Boutons, champs ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 38px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--line); background: #fff; color: var(--ink); font: inherit; font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap; text-decoration: none; }
.btn:hover { background: var(--soft); text-decoration: none; }
.btn:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 3px solid rgba(15, 124, 128, .35); outline-offset: 1px; }
.btn.primary { background: var(--pri); border-color: var(--pri); color: #fff; } .btn.primary:hover { background: var(--pri2); }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; } .btn.ghost:hover { background: rgba(0, 0, 0, .05); }
.btn.ghost.danger { color: var(--bad); background: transparent; border-color: transparent; }
.btn.sm { min-height: 32px; padding: 0 10px; font-size: 13px; }
.btn.lg { min-height: 46px; font-size: 15.5px; } .btn.block { width: 100%; }
.btn.icon { padding: 0; width: 36px; min-height: 36px; }
.btn:disabled { opacity: .55; cursor: default; }
.link { background: none; border: 0; color: var(--pri); font: inherit; font-weight: 600; cursor: pointer; padding: 0; }
input, select, textarea { font: inherit; color: var(--ink); background: #fff; border: 1px solid #ccd5da; border-radius: 8px; min-height: 40px; padding: 8px 11px; width: 100%; }
textarea { min-height: 80px; resize: vertical; }
input[type=checkbox] { width: 18px; height: 18px; min-height: 0; padding: 0; accent-color: var(--pri); flex: none; }
input.num { text-align: end; }
select.filter { width: auto; min-width: 160px; background: #fff; }
select.filter.sm { min-height: 32px; padding: 3px 8px; min-width: 0; font-size: 13px; }
.search { max-width: 280px; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > label, .custom > div > label, .filefield > label { font-size: 13px; font-weight: 600; color: var(--ink2); }
.field small, .fcheck small { color: var(--ink3); font-size: 12.5px; }
.field .ro { min-height: 40px; display: flex; align-items: center; color: var(--ink2); }
.req { color: var(--bad); }
.fcheck { display: grid; grid-template-columns: auto 1fr; align-items: center; column-gap: 10px; row-gap: 2px; cursor: pointer; padding: 6px 0; }
.fcheck small { grid-column: 2; } .fcheck.inline { display: inline-flex; padding: 0; gap: 8px; }
.fgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.fgrid .full, .fgrid .fsec, .fgrid .custom { grid-column: 1 / -1; }
.fsec { font-size: 14px; color: var(--pri2); margin-top: 8px; }
.ferr { color: var(--bad); font-weight: 600; min-height: 1em; margin: 10px 0 0; } .ferr:empty { display: none; }
.finfo { color: var(--good); font-weight: 600; } .finfo:empty { display: none; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.row { display: flex; align-items: center; gap: 10px; } .row.wrap { flex-wrap: wrap; } .stack { display: flex; flex-direction: column; gap: 12px; }

/* ---------- Cartes, onglets, tableaux ---------- */
.card { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 18px 20px; margin-bottom: 16px; }
.card > header { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.card > header h2 { font-size: 16px; flex: 1; }
.sectitle { font-size: 17px; margin: 22px 0 10px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; scrollbar-width: none; }
.tabs button { background: none; border: 0; border-bottom: 3px solid transparent; padding: 10px 12px; font: inherit; font-weight: 600; color: var(--ink3); cursor: pointer; white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; }
.tabs button.on { color: var(--pri); border-bottom-color: var(--pri); }
.tabs .cnt { background: var(--mute-bg); color: var(--ink2); border-radius: 10px; font-size: 11.5px; padding: 0 7px; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar .sum { margin-inline-start: auto; color: var(--ink2); font-size: 13.5px; }
.tblwrap { background: #fff; border-radius: var(--r); box-shadow: var(--shadow); overflow-x: auto; }
.card .tblwrap { box-shadow: none; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: start; font-size: 12px; text-transform: uppercase; letter-spacing: .4px; color: var(--ink3); font-weight: 600; padding: 11px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.click { cursor: pointer; } .tbl tr.click:hover td { background: #f8fbfb; }
.tbl .r { text-align: end; white-space: nowrap; } .tbl .act { width: 44px; text-align: end; } .tbl .chk { width: 36px; }
.tbl.bilan td:last-child { text-align: end; } .tbl.bilan tr.head td { font-weight: 700; background: var(--soft); } .tbl.bilan tr.tot td { font-weight: 700; } .tbl.bilan tr.big td { font-size: 1.1em; border-top: 2px solid var(--line); }
.done { text-decoration: line-through; color: var(--ink3); }
.pill { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 20px; white-space: nowrap; }
.pill.good { background: var(--good-bg); color: var(--good); } .pill.warn { background: var(--warn-bg); color: var(--warn); } .pill.bad { background: var(--bad-bg); color: var(--bad); } .pill.info { background: var(--info-bg); color: var(--info); } .pill.mute { background: var(--mute-bg); color: var(--ink2); }
.empty { text-align: center; padding: 34px 20px; color: var(--ink3); background: #fff; border-radius: var(--r); box-shadow: var(--shadow); }
.empty .i { opacity: .5; } .empty h3 { color: var(--ink); margin: 8px 0 4px; }
.bulk { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: var(--pri-soft); border-radius: 8px; padding: 8px 12px; margin-bottom: 10px; font-weight: 600; }
.back { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; margin-bottom: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 20px; padding: 6px 12px; font: inherit; font-size: 13.5px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.chip.on { background: var(--pri-soft); border-color: var(--pri); color: var(--pri2); font-weight: 600; }
.chip .x { background: none; border: 0; padding: 0; cursor: pointer; color: inherit; display: inline-flex; }
.tpick { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; } .tpick select { width: auto; min-width: 200px; }
.lines { display: flex; flex-direction: column; gap: 8px; } .line { display: flex; gap: 8px; align-items: center; } .line > input, .line > select { flex: 1; min-width: 0; }
.lines > .btn { align-self: flex-start; }
.cle { border: 1px solid var(--line); border-radius: 8px; padding: 10px; margin-bottom: 10px; }
.cleparts { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; margin-top: 8px; }
.cleparts label { display: flex; flex-direction: column; font-size: 12.5px; gap: 3px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.tile { background: #fff; border: 0; border-radius: var(--r); box-shadow: var(--shadow); padding: 16px; display: flex; flex-direction: column; gap: 6px; text-align: start; font: inherit; cursor: pointer; color: var(--ink); }
.tile:hover { box-shadow: 0 0 0 2px var(--pri-soft), var(--shadow); text-decoration: none; }
.tile .i { color: var(--pri); } .tile span { color: var(--ink3); font-size: 13px; }
.tile.stat b { font-size: 28px; line-height: 1.1; }
.kpis { margin-bottom: 16px; } .kpi { background: #fff; border-radius: var(--r); box-shadow: var(--shadow); padding: 14px 16px; display: flex; flex-direction: column; } .kpi span { color: var(--ink3); font-size: 13px; } .kpi b { font-size: 22px; }
.kpis2 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 10px; } .kpis2 > div { display: flex; flex-direction: column; } .kpis2 span { font-size: 12.5px; color: var(--ink3); } .kpis2 b { font-size: 18px; }
.bar { height: 8px; border-radius: 6px; background: var(--mute-bg); overflow: hidden; margin-bottom: 12px; } .bar i { display: block; height: 100%; background: var(--good); border-radius: 6px; }
.mini { list-style: none; margin: 0; padding: 0; } .mini li { display: flex; align-items: center; gap: 6px; border-bottom: 1px solid var(--line); } .mini li:last-child { border-bottom: 0; }
.linkrow { flex: 1; display: flex; align-items: center; gap: 10px; padding: 9px 2px; background: none; border: 0; font: inherit; color: var(--ink); text-align: start; cursor: pointer; min-width: 0; }
.linkrow > span:first-child, .linkrow > span:nth-child(2):not(.pill) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.linkrow:hover { text-decoration: none; color: var(--pri2); }
.more { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; font-size: 13.5px; }
.shortcuts { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; } .shortcuts .btn { flex: 1 1 130px; }
.alerts { display: flex; flex-direction: column; gap: 6px; }
.alert { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px; border: 0; font: inherit; text-align: start; cursor: pointer; background: var(--soft); color: var(--ink); }
.alert span { flex: 1; } .alert.bad { background: var(--bad-bg); color: var(--bad); } .alert.warn { background: var(--warn-bg); color: var(--warn); } .alert.info { background: var(--info-bg); color: var(--info); }
.guide .steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.guide li { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 8px; } .guide li > div { flex: 1; } .guide li.next { background: var(--pri-soft); } .guide li.done { opacity: .6; }
.guide .num { width: 26px; height: 26px; border-radius: 50%; background: var(--mute-bg); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; flex: none; }
.guide li.done .num { background: var(--good); color: #fff; } .guide li.next .num { background: var(--pri); color: #fff; }
.agenda { list-style: none; margin: 0; padding: 0; } .agenda li button { width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px 4px; background: none; border: 0; border-bottom: 1px solid var(--line); font: inherit; text-align: start; cursor: pointer; color: var(--ink); }
.agenda .ad { width: 64px; font-weight: 700; color: var(--pri2); flex: none; } .agenda .at { flex: 1; } .agenda li.past { opacity: .55; } .agenda li.today .ad { color: var(--bad); }
.danger-zone { border-top: 1px solid var(--line); padding-top: 14px; }
.thumb { height: 48px; max-width: 160px; object-fit: contain; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.list { display: flex; flex-direction: column; gap: 8px; }
.preview { background: var(--soft); border-radius: 8px; padding: 12px 14px; } .preview p { margin: 4px 0; }
.kv p { margin: 6px 0; }

/* ---------- Fenêtres, menus, messages ---------- */
.backdrop { position: fixed; inset: 0; background: rgba(12, 28, 34, .45); z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 5vh 16px; overflow-y: auto; animation: fade .12s; }
.modal { background: #fff; border-radius: 14px; width: 100%; max-width: 520px; box-shadow: 0 20px 60px rgba(0, 0, 0, .25); display: flex; flex-direction: column; max-height: 90vh; }
.modal.wide { max-width: 820px; }
.modal > header { display: flex; align-items: center; gap: 10px; padding: 16px 20px 10px; } .modal > header h2 { flex: 1; font-size: 18px; }
.mbody { padding: 4px 20px 16px; overflow-y: auto; }
.modal > footer { display: flex; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--line); flex-wrap: wrap; align-items: center; } .modal > footer .sp { flex: 1; }
.popmenu { position: fixed; z-index: 120; background: #fff; border-radius: 10px; box-shadow: 0 10px 34px rgba(0, 0, 0, .2); padding: 6px; min-width: 210px; display: flex; flex-direction: column; animation: fade .1s; }
.popmenu button { display: flex; align-items: center; gap: 10px; background: none; border: 0; padding: 9px 10px; border-radius: 6px; font: inherit; font-size: 14px; text-align: start; cursor: pointer; color: var(--ink); }
.popmenu button:hover { background: var(--soft); } .popmenu button.danger { color: var(--bad); }
.toasts { position: fixed; inset-block-end: 20px; inset-inline-end: 20px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast { display: flex; align-items: center; gap: 8px; background: #17313a; color: #fff; padding: 11px 14px; border-radius: 10px; box-shadow: 0 6px 24px rgba(0, 0, 0, .2); max-width: 420px; transition: opacity .3s, transform .3s; }
.toast.err { background: var(--bad); } .toast.out { opacity: 0; transform: translateY(8px); }
@keyframes fade { from { opacity: 0; } }

/* ---------- Connexion ---------- */
.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; background: linear-gradient(160deg, #0f3c42 0%, #0f7c80 55%, #e8f2f2 55.1%); }
.authcard { background: #fff; border-radius: 16px; box-shadow: 0 20px 60px rgba(0, 0, 0, .15); padding: 28px; width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 14px; }
.authcard h1 { font-size: 22px; }
.authtop { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.langsel { width: auto; min-height: 34px; padding: 4px 8px; font-size: 13.5px; }
.authform { display: flex; flex-direction: column; gap: 12px; }
.google { gap: 10px; } .or { display: flex; align-items: center; gap: 10px; color: var(--ink3); font-size: 13px; } .or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.switch, .legal { text-align: center; margin: 0; font-size: 14px; } .legal { font-size: 12.5px; color: var(--ink3); }
.legalpage { max-width: 760px; margin: 0 auto; padding: 20px 16px 60px; } .legalpage > header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; } .legalpage .brand { color: var(--ink); padding: 0; }
.legalpage h2 { font-size: 17px; margin: 18px 0 6px; }

/* ---------- États des lieux ---------- */
.piece { padding: 0; } .piece > summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 14px 18px; cursor: pointer; font-weight: 700; }
.piece > summary::-webkit-details-marker { display: none; } .piece > summary .pt { flex: 1; } .piece > summary::after { content: '▾'; color: var(--ink3); } .piece[open] > summary::after { content: '▴'; }
.pbody { padding: 0 18px 16px; display: flex; flex-direction: column; gap: 12px; }
.irow { display: flex; gap: 8px; align-items: center; } .irow.wrap { flex-wrap: wrap; } .irow > .pname, .irow > .iname { flex: 1; font-weight: 600; }
.items { display: flex; flex-direction: column; gap: 10px; }
.item { border: 1px solid var(--line); border-radius: 10px; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.seg.etat { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg.etat button { border: 0; background: #fff; padding: 7px 12px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; color: var(--ink2); border-inline-end: 1px solid var(--line); }
.seg.etat button:last-child { border-inline-end: 0; }
.seg.etat .e-neuf.on { background: var(--info); color: #fff; } .seg.etat .e-bon.on { background: var(--good); color: #fff; } .seg.etat .e-moyen.on { background: #d58a12; color: #fff; } .seg.etat .e-mauvais.on { background: var(--bad); color: #fff; }
.invnums { display: inline-flex; gap: 8px; } .invnums .qty { width: 80px; } .invnums .val { width: 120px; }
.addsel { align-self: flex-start; width: auto; min-width: 220px; color: var(--pri2); font-weight: 600; }
.savestate { font-size: 13px; color: var(--ink3); }
.photos { display: flex; flex-wrap: wrap; gap: 8px; }
.ph { position: relative; width: 96px; height: 72px; border-radius: 8px; overflow: hidden; background: var(--soft); }
.photos.small .ph, .photos.small .phadd { width: 64px; height: 50px; }
.ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.phview { padding: 0; border: 0; background: none; width: 100%; height: 100%; cursor: zoom-in; }
.phdel { position: absolute; top: 3px; inset-inline-end: 3px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .6); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.phadd { width: 96px; height: 72px; border: 1.5px dashed #b8c5cb; border-radius: 8px; background: #fff; color: var(--pri); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
.phadd.busy { opacity: .5; } .phbig { max-width: 100%; max-height: 75vh; display: block; margin: 0 auto; border-radius: 8px; }
.sigs { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; } .sig { display: flex; flex-direction: column; gap: 6px; font-weight: 600; color: var(--ink2); }
.sigimg { border: 1px solid var(--line); border-radius: 8px; max-height: 120px; object-fit: contain; background: #fff; }
.sigwrap { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; margin-bottom: 12px; }
.sigpad { width: 100%; max-width: 600px; aspect-ratio: 600 / 220; border: 1.5px dashed #9fb1b8; border-radius: 10px; touch-action: none; background: #fff; cursor: crosshair; }
.cmp { margin: 0; padding-inline-start: 18px; } .cmp li { margin: 4px 0; }
.docpages { display: flex; flex-direction: column; gap: 14px; align-items: center; }
.docpage { width: 100%; max-width: 720px; height: auto; box-shadow: 0 2px 14px rgba(0, 0, 0, .15); border-radius: 4px; }
.publicdoc { max-width: 820px; margin: 0 auto; padding: 16px; } .publicdoc > header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; } .publicdoc .brand { color: var(--ink); padding: 0; }
.filefield { display: flex; flex-direction: column; gap: 6px; }

/* ---------- Mobile ---------- */
@media (max-width: 900px) {
  .side { transform: translateX(-100%); transition: transform .2s; width: 270px; }
  body.drawer .side { box-shadow: 0 0 40px rgba(0, 0, 0, .3); }
  [dir=rtl] .side { transform: translateX(100%); }
  body.drawer .side { transform: none; }
  body.drawer .scrim { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .35); z-index: 25; }
  .main { margin-inline-start: 0; }
  .top .burger { display: inline-flex; }
  .top { padding: 12px 14px 8px; gap: 8px; flex-wrap: wrap; }
  .top h1 { font-size: 19px; }
  .top .actions { width: 100%; justify-content: stretch; } .top .actions .btn { flex: 1; }
  .page { padding: 4px 12px 80px; }
  .fgrid, .grid2, .grid3 { grid-template-columns: 1fr; }
  .grid3.kpis, .grid3:has(.tile.stat) { grid-template-columns: repeat(3, 1fr); gap: 8px; } .tile.stat { padding: 12px; } .tile.stat b { font-size: 22px; }
  .card { padding: 14px; }
  .modal { max-height: none; border-radius: 14px; } .backdrop { padding: 10px 8px; }
  .tblwrap { background: transparent; box-shadow: none; overflow: visible; }
  .tbl thead { display: none; }
  .tbl, .tbl tbody, .tbl tr, .tbl td { display: block; width: 100%; }
  .tbl tr { background: #fff; border-radius: var(--r); box-shadow: var(--shadow); margin-bottom: 10px; padding: 10px 12px; position: relative; }
  .tbl td { border: 0; padding: 3px 0; padding-inline-end: 40px; text-align: start !important; }
  .tbl td.r { font-weight: 600; }
  .tbl td[data-label]:not([data-label=""]):not(:first-child)::before { content: attr(data-label) ' : '; color: var(--ink3); font-size: 12.5px; font-weight: 400; }
  .tbl td.act { position: absolute; top: 6px; inset-inline-end: 6px; width: auto; padding: 0; }
  .tbl td.chk { position: absolute; bottom: 10px; inset-inline-end: 12px; width: auto; padding: 0; }
  .search, select.filter { max-width: none; flex: 1 1 140px; }
  .sigs { grid-template-columns: 1fr; }
  .kpis2 b { font-size: 16px; }
  .toasts { inset-inline: 12px; inset-block-end: 14px; }
  .addsel { width: 100%; }
}
@media print { .side, .top, .toasts { display: none; } .main { margin: 0; } }
