@font-face { font-family: 'Manrope'; src: url('/fonts/manrope.woff2') format('woff2'); font-weight: 200 800; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215; }
@font-face { font-family: 'Manrope'; src: url('/fonts/manrope-ext.woff2') format('woff2'); font-weight: 200 800; font-display: swap; unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --primary: #059A72; --secondary: #0DB7CE; --brand-dark: #002333; --primary-rgb: 5,154,114; --secondary-rgb: 13,183,206;
  --cream: #FDFDE8;
  --bg: #f4f7f7; --surface: #ffffff; --surface-2: #f8fafa; --border: #e3eaea; --border-strong: #cfd9d9;
  --text: #0f2a33; --muted: #5f7379; --faint: #8a9ca1;
  --green: #0f9d58; --blue: #2b7de9; --amber: #d98a00; --red: #dc3545; --violet: #7c4dff; --gray: #6b7c82;
  --radius: 12px; --radius-sm: 8px; --shadow: 0 1px 2px rgba(0,35,51,.05), 0 4px 16px rgba(0,35,51,.04);
  --side-w: 248px; --top-h: 60px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --bg: #0b1a20; --surface: #10242c; --surface-2: #142c35; --border: #1f3a44; --border-strong: #2b4b56; --text: #e5f0f2; --muted: #9ab0b6; --faint: #6f878e; --shadow: 0 1px 2px rgba(0,0,0,.3); color-scheme: dark; } }
:root[data-theme="dark"] { --bg: #0b1a20; --surface: #10242c; --surface-2: #142c35; --border: #1f3a44; --border-strong: #2b4b56; --text: #e5f0f2; --muted: #9ab0b6; --faint: #6f878e; --shadow: 0 1px 2px rgba(0,0,0,.3); color-scheme: dark; }

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; font-size: 14px; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--primary); text-decoration: none; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -.01em; }
code, .mono { font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace; font-size: 12px; }
.muted { color: var(--muted); } .faint { color: var(--faint); } .small { font-size: 12px; } .right { text-align: right; } .center { text-align: center; } .nowrap { white-space: nowrap; }
.ic { width: 18px; height: 18px; flex: none; }
.hidden, [hidden] { display: none !important; }
.boot { height: 100vh; display: grid; place-items: center; align-content: center; gap: 10px; font-weight: 700; font-size: 20px; color: var(--brand-dark); }
.loading { padding: 60px; text-align: center; color: var(--muted); }

/* ---------- layout ---------- */
.layout { display: flex; min-height: 100vh; }
.side { width: var(--side-w); flex: none; background: var(--surface); border-right: 1px solid var(--border); position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; z-index: 40; transition: transform .2s; }
.brand { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); min-height: var(--top-h); }
.brand img { width: 36px; height: 36px; object-fit: contain; border-radius: 9px; background: #fff; padding: 3px; border: 1px solid var(--border); }
.brand b { display: block; font-size: 15px; line-height: 1.15; } .brand small { display: block; font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; line-height: 1.3; }
.side nav { flex: 1; overflow-y: auto; padding: 8px 10px 16px; }
.nav-t { font-size: 10.5px; font-weight: 700; color: var(--faint); text-transform: uppercase; letter-spacing: .08em; padding: 14px 10px 6px; }
.nav-i { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 9px; color: var(--text); font-weight: 550; margin: 1px 0; opacity: .86; }
.nav-i:hover { background: var(--surface-2); opacity: 1; }
.nav-i.active { background: linear-gradient(100deg, var(--primary), var(--secondary)); color: #fff; opacity: 1; box-shadow: 0 4px 12px rgba(var(--primary-rgb), .25); }
.nav-i .ic { width: 17px; height: 17px; }
.side-foot { padding: 10px 16px; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted); }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.top { height: var(--top-h); display: flex; align-items: center; gap: 10px; padding: 0 20px; background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 30; }
.crumb { font-weight: 650; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-r { display: flex; align-items: center; gap: 6px; }
.content { padding: 26px 28px 60px; max-width: 1500px; width: 100%; }
body.collapsed .side { display: none; }
.scrim { display: none; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 9px; border: 0; background: transparent; color: var(--muted); cursor: pointer; position: relative; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.bell .dot { position: absolute; top: 3px; right: 3px; background: var(--red); color: #fff; font-size: 10px; border-radius: 10px; padding: 0 5px; line-height: 16px; }
.lang { border: 0; background: transparent; color: var(--text); font: inherit; font-weight: 650; cursor: pointer; padding: 6px 8px; border-radius: 8px; }
.lang:hover { background: var(--surface-2); }
.sync { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-size: 12px; font-weight: 600; padding: 5px 10px; border-radius: 20px; cursor: pointer; }
.sync.on .ic { color: var(--green); } .sync.off { border-color: rgba(220,53,69,.35); background: rgba(220,53,69,.07); } .sync.off .ic { color: var(--red); }
.sync.busy .ic { animation: spin 1s linear infinite; } @keyframes spin { to { transform: rotate(360deg); } }
.sync .ic { width: 15px; height: 15px; }
.pill { background: var(--amber); color: #fff; border-radius: 10px; padding: 0 6px; font-size: 11px; line-height: 17px; } .pill.red { background: var(--red); }
.me { display: flex; align-items: center; gap: 9px; padding: 4px 6px 4px 4px; border-radius: 10px; cursor: pointer; position: relative; }
.me:hover { background: var(--surface-2); }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, var(--primary), var(--secondary)); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.me-t b { display: block; font-size: 13px; line-height: 1.2; } .me-t small { display: block; font-size: 11px; color: var(--muted); }
.menu { display: none; position: absolute; right: 0; top: 46px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.12); min-width: 200px; padding: 6px; z-index: 50; }
.menu.on { display: block; }
.menu a, .menu button { display: flex; gap: 9px; align-items: center; width: 100%; padding: 9px 10px; border: 0; background: none; color: var(--text); font: inherit; border-radius: 7px; cursor: pointer; text-align: left; }
.menu a:hover, .menu button:hover { background: var(--surface-2); }

/* ---------- page ---------- */
.page-h { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.ph-l { display: flex; gap: 14px; align-items: center; }
.ph-ic { width: 44px; height: 44px; border-radius: 12px; background: linear-gradient(135deg, var(--primary), var(--secondary)); color: #fff; display: grid; place-items: center; }
.page-h h1 { font-size: 24px; font-weight: 750; } .page-h p { margin: 4px 0 0; color: var(--muted); }
.ph-a { display: flex; gap: 8px; flex-wrap: wrap; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-h { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.card-h h3 { font-size: 15px; font-weight: 700; display: flex; gap: 8px; align-items: center; }
.card-b { padding: 16px 18px; }
.grid { display: grid; gap: 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; } .mt { margin-top: 16px; } .mb { margin-bottom: 16px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; } .row.between { justify-content: space-between; } .grow { flex: 1; }

/* KPI */
.kpi { padding: 16px 18px; display: flex; justify-content: space-between; gap: 10px; }
.kpi .l { color: var(--muted); font-size: 13px; font-weight: 550; } .kpi .v { font-size: 26px; font-weight: 750; margin-top: 6px; letter-spacing: -.02em; }
.kpi .i { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; }
.tone-green { background: rgba(15,157,88,.1); color: var(--green); } .tone-blue { background: rgba(43,125,233,.1); color: var(--blue); } .tone-amber { background: rgba(217,138,0,.12); color: var(--amber); }
.tone-red { background: rgba(220,53,69,.1); color: var(--red); } .tone-violet { background: rgba(124,77,255,.1); color: var(--violet); }
a.kpi:hover { border-color: var(--border-strong); }
.hero { background: linear-gradient(125deg, var(--primary) 0%, var(--secondary) 120%); color: #fff; border: 0; padding: 20px 22px; position: relative; overflow: hidden; }
.hero::after { content: ''; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%; background: rgba(255,255,255,.08); }
.hero .lbl { font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; opacity: .9; }
.hero .big { font-size: 40px; font-weight: 800; margin: 10px 0 2px; letter-spacing: -.03em; }
.hero .cats { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 26px; margin-top: 16px; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.22); position: relative; z-index: 1; }
.hero .cats a { color: #fff; display: flex; justify-content: space-between; font-weight: 600; font-size: 13px; padding: 3px 0; }
.hero .cats a:hover { text-decoration: underline; }
.dotc { width: 9px; height: 9px; border-radius: 50%; display: inline-block; margin-right: 8px; }
.shortcut { display: flex; gap: 12px; align-items: center; padding: 14px 16px; color: var(--text); }
.shortcut:hover { border-color: var(--primary); }
.shortcut b { display: block; } .shortcut small { color: var(--muted); }
.shortcut .ic.go { margin-left: auto; color: var(--faint); }
.bar { height: 8px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--primary), var(--secondary)); border-radius: 6px; }

/* ---------- boutons & formulaires ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font: inherit; font-weight: 650; font-size: 13.5px; padding: 8px 14px; border-radius: 9px; cursor: pointer; white-space: nowrap; line-height: 1.2; }
.btn:hover { background: var(--surface-2); }
.btn .ic { width: 16px; height: 16px; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 2px 8px rgba(var(--primary-rgb), .25); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.grad { background: linear-gradient(100deg, var(--primary), var(--secondary)); border: 0; color: #fff; }
.btn.danger { background: var(--red); border-color: var(--red); color: #fff; } .btn.warn { background: var(--amber); border-color: var(--amber); color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; } .btn.ghost:hover { background: var(--surface-2); }
.btn.sm { padding: 5px 10px; font-size: 12.5px; } .btn.block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.act { display: inline-flex; gap: 2px; } .act .icon-btn { width: 30px; height: 30px; } .act .icon-btn .ic { width: 16px; height: 16px; }
.icon-btn.del:hover { color: var(--red); background: rgba(220,53,69,.08); }
label.f { display: block; } label.f > span { display: block; font-size: 12.5px; font-weight: 650; margin-bottom: 5px; color: var(--text); }
label.f > span em { color: var(--red); font-style: normal; } label.f small { display: block; color: var(--faint); font-size: 11.5px; margin-top: 4px; }
input, select, textarea { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border-strong); border-radius: 9px; padding: 8px 11px; width: 100%; min-height: 38px; outline: none; }
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(var(--primary-rgb), .15); }
input[type=checkbox], input[type=radio] { width: 17px; height: 17px; min-height: 0; accent-color: var(--primary); margin: 0; }
input[type=color] { padding: 3px; width: 54px; height: 38px; }
.chk { display: flex; gap: 9px; align-items: center; cursor: pointer; font-weight: 550; padding: 3px 0; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.form-grid .full { grid-column: 1 / -1; }
.money { display: flex; gap: 6px; } .money select { width: 96px; flex: none; }
.search { position: relative; } .search .ic { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--faint); width: 16px; height: 16px; } .search input { padding-left: 34px; }
.toolbar { display: flex; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); flex-wrap: wrap; align-items: center; }
.toolbar .search { flex: 1; min-width: 220px; max-width: 360px; } .toolbar select { width: auto; min-width: 150px; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 4px 12px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 9px; max-height: 190px; overflow: auto; }
fieldset { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; margin: 0; } legend { font-weight: 700; font-size: 12.5px; padding: 0 6px; color: var(--muted); }

/* ---------- tableaux ---------- */
.table-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; padding: 11px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
.tbl th[data-sort] { cursor: pointer; user-select: none; } .tbl th[data-sort]::after { content: ' ⇅'; opacity: .35; } .tbl th[data-dir=asc]::after { content: ' ↑'; opacity: .8; } .tbl th[data-dir=desc]::after { content: ' ↓'; opacity: .8; }
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tbody tr:hover { background: var(--surface-2); }
.tbl tr.click { cursor: pointer; }
.tbl .tag { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; color: var(--primary); font-weight: 600; white-space: nowrap; }
.tbl .sub { display: block; font-size: 12px; color: var(--muted); }
.tbl td.act-c { text-align: right; white-space: nowrap; }
.empty { padding: 48px 20px; text-align: center; color: var(--muted); } .empty .ic { width: 36px; height: 36px; color: var(--faint); }
.badge { display: inline-flex; align-items: center; font-size: 11.5px; font-weight: 650; padding: 2px 9px; border-radius: 20px; white-space: nowrap; border: 1px solid transparent; }
.badge.green { background: rgba(15,157,88,.1); color: var(--green); border-color: rgba(15,157,88,.25); } .badge.blue { background: rgba(43,125,233,.1); color: var(--blue); border-color: rgba(43,125,233,.25); }
.badge.amber { background: rgba(217,138,0,.1); color: var(--amber); border-color: rgba(217,138,0,.28); } .badge.red { background: rgba(220,53,69,.08); color: var(--red); border-color: rgba(220,53,69,.25); }
.badge.violet { background: rgba(124,77,255,.1); color: var(--violet); border-color: rgba(124,77,255,.25); } .badge.gray { background: rgba(107,124,130,.1); color: var(--gray); border-color: rgba(107,124,130,.22); }
.chip { display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); margin: 1px 2px 1px 0; }
.offline-banner { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 9px; background: rgba(217,138,0,.1); color: var(--amber); font-weight: 600; font-size: 12.5px; margin-bottom: 14px; }

/* tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); padding: 0 14px; overflow-x: auto; }
.tabs button { border: 0; background: none; font: inherit; font-weight: 650; color: var(--muted); padding: 12px 12px; cursor: pointer; border-bottom: 2px solid transparent; display: flex; gap: 7px; align-items: center; white-space: nowrap; }
.tabs button.on { color: var(--primary); border-bottom-color: var(--primary); }
.tabs .count { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; font-size: 11px; padding: 0 7px; }

/* définitions (vue actif) */
.dl { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px 22px; }
.dl div > span { display: block; font-size: 11.5px; color: var(--muted); font-weight: 600; margin-bottom: 3px; }
.dl div > b { font-weight: 600; word-break: break-word; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { padding: 9px 0 9px 18px; border-left: 2px solid var(--border); position: relative; font-size: 13px; }
.timeline li::before { content: ''; position: absolute; left: -6px; top: 13px; width: 10px; height: 10px; border-radius: 50%; background: var(--primary); }
ul.plain { margin: 0; padding-left: 18px; }

/* modale & toasts */
.modal-wrap { position: fixed; inset: 0; background: rgba(0,25,35,.45); display: grid; place-items: center; z-index: 100; padding: 16px; animation: fade .15s; }
.modal-wrap.out { opacity: 0; transition: opacity .15s; }
@keyframes fade { from { opacity: 0; } }
.modal { background: var(--surface); border-radius: 14px; width: min(560px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; box-shadow: 0 24px 60px rgba(0,0,0,.25); }
.modal.wide { width: min(900px, 100%); }
.modal-h { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.modal-h h3 { font-size: 16px; }
.modal-b { padding: 18px; overflow-y: auto; }
.modal-f { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--border); }
#toasts { position: fixed; bottom: 18px; right: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 200; }
.toast { display: flex; gap: 9px; align-items: center; background: var(--brand-dark); color: #fff; padding: 11px 14px; border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.2); max-width: 420px; font-weight: 550; animation: up .2s; }
.toast.error { background: var(--red); } .toast.warn { background: var(--amber); } .toast.out { opacity: 0; transform: translateY(6px); transition: .3s; }
.toast .ic { color: var(--secondary); } .toast.error .ic, .toast.warn .ic { color: #fff; }
@keyframes up { from { transform: translateY(10px); opacity: 0; } }

/* login */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; background: var(--surface); }
.auth-art { background: var(--brand-dark); color: #fff; padding: 48px 56px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-art::before { content: ''; position: absolute; width: 520px; height: 520px; border-radius: 50%; border: 70px solid rgba(var(--secondary-rgb), .09); right: -200px; bottom: -180px; }
.auth-art::after { content: ''; position: absolute; width: 300px; height: 300px; border-radius: 50%; border: 50px solid rgba(var(--primary-rgb), .12); left: -120px; top: -100px; }
.auth-art .lg { display: flex; align-items: center; gap: 14px; font-size: 30px; font-weight: 700; position: relative; z-index: 1; }
.auth-art .lg img { width: 58px; }
.auth-art h2 { font-size: 34px; line-height: 1.15; font-weight: 750; max-width: 460px; position: relative; z-index: 1; }
.auth-art h2 span { color: var(--secondary); }
.auth-art p { color: #b9ccd1; max-width: 440px; line-height: 1.6; position: relative; z-index: 1; }
.auth-feats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 20px; max-width: 460px; position: relative; z-index: 1; }
.auth-feats div { display: flex; gap: 9px; align-items: center; color: #dfeaec; font-size: 13px; } .auth-feats .ic { color: var(--secondary); }
.auth-form { display: grid; place-items: center; padding: 32px; background: var(--cream); }
:root[data-theme="dark"] .auth-form { background: var(--bg); }
.auth-box { width: min(400px, 100%); }
.auth-box h1 { font-size: 26px; font-weight: 750; } .auth-box > p { color: var(--muted); margin: 6px 0 24px; }
.auth-box form { display: grid; gap: 14px; }
.sep { display: flex; align-items: center; gap: 12px; color: var(--faint); font-size: 12px; margin: 22px 0; } .sep::before, .sep::after { content: ''; flex: 1; height: 1px; background: var(--border-strong); }
.demo-box { margin-top: 22px; font-size: 12px; color: var(--muted); background: var(--surface); border: 1px dashed var(--border-strong); border-radius: 10px; padding: 10px 12px; line-height: 1.6; }

/* scanner / inventaire */
.scan-area { display: grid; grid-template-columns: 340px 1fr; gap: 16px; }
#reader { width: 100%; border-radius: 12px; overflow: hidden; background: #000; min-height: 0; }
#reader video { border-radius: 12px; }
.scan-input { display: flex; gap: 8px; }
.scan-input input { font-size: 16px; font-family: ui-monospace, Menlo, monospace; }
.res-pill { display: inline-flex; gap: 4px; font-weight: 700; font-size: 12px; margin-right: 12px; }
.inv-card { padding: 16px 18px; display: block; color: var(--text); }
.inv-card:hover { border-color: var(--primary); }
.inv-card .r { font-family: ui-monospace, monospace; font-size: 11.5px; color: var(--muted); }
.inv-card h3 { font-size: 16px; margin: 4px 0 2px; }

/* champs (personnalisation) */
.frow { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-bottom: 1px solid var(--border); background: var(--surface); }
.frow.dragging { opacity: .5; } .frow.over { box-shadow: inset 0 2px 0 var(--primary); }
.frow .h { cursor: grab; color: var(--faint); } .frow .t { flex: 1; min-width: 0; } .frow .t b { font-weight: 650; } .frow .t code { color: var(--faint); margin-left: 6px; }
.frow.off { opacity: .55; }
.sec-h { padding: 10px 14px; font-size: 11px; font-weight: 750; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); background: var(--surface-2); border-bottom: 1px solid var(--border); }

/* rapports */
.rep-card { display: flex; gap: 14px; padding: 16px 18px; color: var(--text); align-items: flex-start; }
.rep-card:hover { border-color: var(--primary); } .rep-card b { display: block; font-size: 15px; } .rep-card small { color: var(--muted); }
.rep-card .ic.go { margin-left: auto; color: var(--faint); }
.chart-box { position: relative; height: 280px; }

/* étiquettes QR */
.labels { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.label { display: flex; gap: 10px; align-items: center; border: 1px dashed var(--border-strong); border-radius: 8px; padding: 8px; background: #fff; color: #000; page-break-inside: avoid; }
.label img { width: 92px; height: 92px; } .label b { display: block; font-family: ui-monospace, monospace; font-size: 13px; } .label small { display: block; font-size: 10.5px; line-height: 1.35; }


/* ---------- tableau de bord personnalisable ---------- */
.wgrid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); grid-auto-flow: row dense; gap: 16px; align-items: stretch; }
.widget { position: relative; min-width: 0; }
.w-3 { grid-column: span 3; } .w-4 { grid-column: span 4; } .w-6 { grid-column: span 6; } .w-8 { grid-column: span 8; } .w-12 { grid-column: span 12; }
.widget.card.w-kpi, .widget > .w-kpi { height: 100%; }
.widget > a.kpi { color: inherit; height: 100%; }
.widget.editing { outline: 2px dashed rgba(var(--primary-rgb), .45); outline-offset: 3px; cursor: grab; }
.widget.editing a { pointer-events: none; }
.widget.dragging { opacity: .4; }
.widget.over { outline-color: var(--primary); outline-style: solid; }
.w-tools { position: absolute; top: 8px; right: 8px; display: flex; gap: 6px; z-index: 3; }
.w-tools .w-drag { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--surface); border: 1px solid var(--border); color: var(--muted); cursor: grab; }
.w-tools .icon-btn.del { width: 30px; height: 30px; background: var(--surface); border: 1px solid var(--border); color: #dc3545; }
.chart-box { position: relative; }
@media (max-width: 1200px) { .w-3 { grid-column: span 6; } .w-4 { grid-column: span 6; } .w-8 { grid-column: span 12; } }
@media (max-width: 720px) { .wgrid { gap: 12px; } .w-3, .w-4, .w-6, .w-8, .w-12 { grid-column: span 12; } }

@media print {
  .side, .top, .no-print, .ph-a, #toasts { display: none !important; }
  body, .content { background: #fff; padding: 0; } .card { box-shadow: none; border: 0; }
  .labels { grid-template-columns: repeat(3, 1fr); gap: 4mm; } .label { border: 1px solid #ccc; }
}

/* responsive */
@media (max-width: 1200px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 1000px) {
  .side { position: fixed; left: 0; transform: translateX(-100%); box-shadow: 0 0 40px rgba(0,0,0,.2); }
  .side.open { transform: none; }
  .scrim.on { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 35; }
  .g3 { grid-template-columns: 1fr; } .scan-area { grid-template-columns: 1fr; }
  .auth { grid-template-columns: 1fr; } .auth-art { display: none; }
}
@media (max-width: 720px) {
  .content { padding: 18px 14px 50px; } .top { padding: 0 10px; gap: 4px; }
  .g2, .g4, .form-grid { grid-template-columns: 1fr; } .span2 { grid-column: auto; }
  .me-t, .sync-l, .crumb { display: none; } .page-h h1 { font-size: 21px; }
  .toolbar .search { max-width: none; } .toolbar select { flex: 1; min-width: 130px; }
  .hero .cats { grid-template-columns: 1fr; }
}
