:root {
  --bg: #09090b;
  --sidebar: #0e0e11;
  --panel: #121215;
  --panel-2: #18181c;
  --panel-3: #202026;
  --border: #26262c;
  --border-2: #34343c;
  --text: #f4f4f5;
  --muted: #a1a1aa;
  --faint: #71717a;
  --accent: #3b82f6;
  --accent-2: #2563eb;
  --accent-soft: rgba(59, 130, 246, .16);
  --accent-text: #93c5fd;
  --green: #22c55e;
  --green-soft: rgba(34, 197, 94, .14);
  --green-text: #86efac;
  --amber: #f59e0b;
  --amber-soft: rgba(245, 158, 11, .15);
  --amber-text: #fcd34d;
  --red: #ef4444;
  --red-soft: rgba(239, 68, 68, .15);
  --red-text: #fca5a5;
  --violet: #8b5cf6;
  --violet-soft: rgba(139, 92, 246, .16);
  --violet-text: #c4b5fd;
  --radius: 10px;
  --radius-sm: 7px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .45);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }
img { display: block; }
svg { flex: none; vertical-align: -0.125em; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--accent-soft); }
h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
h1 { font-size: 20px; }
h2 { font-size: 16px; }
h3 { font-size: 14px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12px; }
.tiny { font-size: 11px; }
.mono { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 12px; }
.nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.row { display: flex; align-items: center; gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.col { display: flex; flex-direction: column; gap: 8px; }
.grow { flex: 1; min-width: 0; }
.right { margin-left: auto; }
.center { text-align: center; }
.hidden { display: none !important; }
.gap-4 { gap: 4px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; }
.mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; } .mb-12 { margin-bottom: 12px; } .mb-16 { margin-bottom: 16px; }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.sidebar {
  background: var(--sidebar);
  border-right: 1px solid var(--border);
  padding: 14px 10px;
  display: flex; flex-direction: column; gap: 2px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 10px 18px; font-weight: 700; font-size: 16px; }
.brand-logo { width: 30px; height: 30px; border-radius: 8px; background: linear-gradient(135deg, var(--accent), var(--violet)); display: grid; place-items: center; }
.brand-logo svg { width: 18px; height: 18px; color: white; }
.nav-section { color: var(--faint); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; padding: 14px 12px 6px; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 8px 12px; border-radius: 8px;
  color: var(--muted); font-weight: 520; cursor: pointer; user-select: none;
  text-decoration: none !important;
}
.nav-item svg { width: 17px; height: 17px; flex: none; }
.nav-item:hover { background: var(--panel-2); color: var(--text); }
.nav-item.active { background: var(--panel-3); color: var(--text); }
.nav-item .count { margin-left: auto; background: var(--accent); color: white; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 99px; }
.nav-item .count.amber { background: var(--amber); color: #111; }
.nav-item .count.green { background: var(--green); color: #052e12; }
.sidebar-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 6px; }
.sync-line { display: flex; align-items: center; gap: 8px; padding: 4px 12px; font-size: 12px; color: var(--muted); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: none; }
.dot.ok { background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.dot.warn { background: var(--amber); box-shadow: 0 0 0 3px var(--amber-soft); }
.dot.err { background: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px;
  padding: 12px 24px; background: rgba(9, 9, 11, .86); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar h1 { font-size: 17px; }
.topbar .menu-btn { display: none; }
.content { padding: 22px 24px 90px; max-width: 1500px; width: 100%; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head .sub { color: var(--muted); margin-top: 4px; }

.bottom-nav { display: none; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; inset: 0 auto 0 0; width: 270px; z-index: 60;
    transform: translateX(-100%); transition: transform .2s ease;
  }
  .shell.drawer-open .sidebar { transform: none; box-shadow: var(--shadow); }
  .shell.drawer-open::after { content: ""; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 50; }
  .topbar { padding: 10px 14px; }
  .topbar .menu-btn { display: inline-flex; }
  .content { padding: 16px 14px 96px; }
  .bottom-nav {
    display: grid; grid-template-columns: repeat(5, 1fr);
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 40;
    background: rgba(14, 14, 17, .96); backdrop-filter: blur(10px);
    border-top: 1px solid var(--border);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .bottom-nav a { display: flex; flex-direction: column; align-items: center; gap: 3px; color: var(--muted); font-size: 10.5px; padding: 4px 0; text-decoration: none; position: relative; }
  .bottom-nav a svg { width: 21px; height: 21px; }
  .bottom-nav a.active { color: var(--text); }
  .bottom-nav a .count { position: absolute; top: 0; left: calc(50% + 6px); background: var(--accent); color: #fff; font-size: 10px; font-weight: 700; border-radius: 99px; padding: 0 5px; }
  .hide-mobile { display: none !important; }
}
@media (min-width: 901px) { .show-mobile { display: none !important; } }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 34px; padding: 0 13px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-2); background: var(--panel-2); color: var(--text);
  font-weight: 560; font-size: 13px; cursor: pointer; white-space: nowrap; user-select: none;
  text-decoration: none !important; transition: background .12s, border-color .12s, transform .05s;
}
.btn:hover { background: var(--panel-3); border-color: #45454f; }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn.disabled { opacity: .45; cursor: not-allowed; pointer-events: none; }
.btn svg { width: 15px; height: 15px; }
.btn-primary { background: var(--accent-2); border-color: var(--accent-2); color: #fff; }
.btn-primary:hover { background: var(--accent); border-color: var(--accent); }
.btn-success { background: #15803d; border-color: #16a34a; color: #fff; }
.btn-success:hover { background: #16a34a; }
.btn-danger { background: var(--red-soft); border-color: rgba(239,68,68,.4); color: var(--red-text); }
.btn-danger:hover { background: rgba(239,68,68,.25); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--panel-2); color: var(--text); }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12px; }
.btn-lg { height: 46px; padding: 0 20px; font-size: 15px; border-radius: var(--radius); }
.btn-xl { height: 58px; padding: 0 26px; font-size: 17px; border-radius: 12px; font-weight: 650; }
.btn-block { width: 100%; }
.icon-btn { width: 34px; padding: 0; }
.icon-btn.btn-sm { width: 28px; }
.qty-btn { min-width: 46px; height: 40px; font-size: 15px; font-weight: 700; }

/* ---------- Champs ---------- */
.input, .select, textarea.input {
  height: 34px; padding: 0 11px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-2); background: var(--panel); color: var(--text);
  outline: none; min-width: 0;
}
textarea.input { height: auto; padding: 8px 11px; resize: vertical; }
.input:focus, .select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input-lg { height: 52px; font-size: 17px; padding: 0 16px; border-radius: var(--radius); }
.search { position: relative; }
.search > svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--faint); pointer-events: none; }
.search .input { padding-left: 33px; width: 100%; }
.search.lg > svg { left: 16px; width: 20px; height: 20px; }
.search.lg .input { padding-left: 46px; }
label.field { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--muted); font-weight: 550; }
label.field .input, label.field .select { font-size: 14px; color: var(--text); font-weight: 400; }
.switch { display: flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.switch input { appearance: none; width: 38px; height: 22px; border-radius: 99px; background: var(--border-2); position: relative; cursor: pointer; transition: background .15s; flex: none; margin: 0; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch input:checked { background: var(--accent-2); }
.switch input:checked::after { transform: translateX(16px); }

/* ---------- Chips / filtres ---------- */
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px;
  border-radius: 99px; border: 1px solid var(--border-2); background: var(--panel);
  color: var(--muted); font-size: 12.5px; font-weight: 560; cursor: pointer; user-select: none; white-space: nowrap;
}
.chip:hover { color: var(--text); border-color: #4a4a55; }
.chip.active { background: var(--accent-soft); border-color: rgba(59,130,246,.55); color: var(--accent-text); }
.chip .n { font-size: 11px; background: var(--panel-3); color: var(--text); border-radius: 99px; padding: 0 6px; }
.chip.active .n { background: var(--accent-2); color: #fff; }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px;
  border-radius: 6px; font-size: 11.5px; font-weight: 620; white-space: nowrap;
  background: var(--panel-3); color: var(--muted); border: 1px solid transparent;
}
.badge svg { width: 12px; height: 12px; }
.badge.blue { background: var(--accent-soft); color: var(--accent-text); border-color: rgba(59,130,246,.28); }
.badge.green { background: var(--green-soft); color: var(--green-text); border-color: rgba(34,197,94,.28); }
.badge.amber { background: var(--amber-soft); color: var(--amber-text); border-color: rgba(245,158,11,.28); }
.badge.red { background: var(--red-soft); color: var(--red-text); border-color: rgba(239,68,68,.3); }
.badge.violet { background: var(--violet-soft); color: var(--violet-text); border-color: rgba(139,92,246,.3); }
.badge.gray { background: var(--panel-3); color: var(--muted); border-color: var(--border-2); }
.badge.lg { height: 28px; padding: 0 11px; font-size: 13px; border-radius: 8px; }

/* ---------- Cartes ---------- */
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); }
.card-pad { padding: 16px; }
.card-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.card-body { padding: 16px; }
.grid { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.grid-auto-sm { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.span-2 { grid-column: span 2; min-width: 0; }
@media (max-width: 1100px) { .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) { .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); } .span-2 { grid-column: auto; } }

.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.kpi { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; cursor: pointer; text-decoration: none !important; color: var(--text); display: block; transition: border-color .12s, background .12s; }
.kpi:hover { border-color: var(--border-2); background: var(--panel-2); }
.kpi .label { color: var(--muted); font-size: 12px; font-weight: 560; display: flex; align-items: center; gap: 7px; }
.kpi .label svg { width: 14px; height: 14px; }
.kpi .value { font-size: 28px; font-weight: 720; letter-spacing: -.02em; margin-top: 6px; font-variant-numeric: tabular-nums; }
.kpi .hint { color: var(--faint); font-size: 12px; margin-top: 2px; }
.kpi.green .value { color: var(--green-text); }
.kpi.amber .value { color: var(--amber-text); }
.kpi.red .value { color: var(--red-text); }
.kpi.blue .value { color: var(--accent-text); }
.kpi.violet .value { color: var(--violet-text); }

/* ---------- Tableau ---------- */
.table-wrap { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); overflow: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
  text-align: left; font-weight: 600; color: var(--text); font-size: 12.5px;
  padding: 11px 12px; border-bottom: 1px solid var(--border); background: var(--panel);
  position: sticky; top: 0; z-index: 1; white-space: nowrap;
}
.table td { padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tbody tr:hover td { background: rgba(255,255,255,.018); }
.table tr.clickable { cursor: pointer; }
.table tr.selected td { background: var(--accent-soft) !important; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }
.cell-item { display: flex; align-items: center; gap: 10px; min-width: 240px; max-width: 400px; }
.cell-item .t { font-weight: 560; color: var(--accent-text); }
.date-cell .d { font-weight: 560; white-space: nowrap; }
.date-cell .h { color: var(--faint); font-size: 11.5px; }

/* ---------- Images ---------- */
.thumb { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; background: var(--panel-3); flex: none; border: 1px solid var(--border); }
.thumb.sm { width: 34px; height: 34px; border-radius: 6px; }
.thumb.lg { width: 72px; height: 72px; border-radius: 10px; }
.thumb.xl { width: 120px; height: 120px; border-radius: 12px; }
.cover { width: 100%; height: 100%; object-fit: cover; }
.ph { display: grid; place-items: center; color: var(--faint); }
.ph svg { width: 40%; height: 40%; }

/* ---------- Cartes produit ---------- */
.pcard { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; transition: border-color .12s; }
.pcard:hover { border-color: var(--border-2); }
.pcard .img { position: relative; aspect-ratio: 1 / 1; background: var(--panel-3); }
.pcard .img img { width: 100%; height: 100%; object-fit: cover; }
.pcard .img .corner { position: absolute; top: 8px; left: 8px; display: flex; gap: 5px; flex-wrap: wrap; }
.pcard .img .corner-r { position: absolute; top: 8px; right: 8px; }
.pcard .img .badge { background-color: rgba(9, 9, 11, .82); backdrop-filter: blur(6px); }
.pcard .body { padding: 11px 12px 12px; display: flex; flex-direction: column; gap: 7px; flex: 1; }
.pcard .title { font-weight: 580; font-size: 13.5px; line-height: 1.35; }
.pcard .meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.pcard .actions { display: flex; gap: 6px; margin-top: auto; padding-top: 4px; }
.pcard.flash-green { animation: flashG .9s ease; }
@keyframes flashG { 0% { box-shadow: 0 0 0 3px var(--green); } 100% { box-shadow: 0 0 0 0 transparent; } }

.stock-pills { display: flex; gap: 5px; flex-wrap: wrap; }
.stock-pills .sp { font-size: 11.5px; padding: 2px 7px; border-radius: 6px; background: var(--panel-3); color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }
.stock-pills .sp b { color: var(--text); }
.stock-pills .sp.green { background: var(--green-soft); color: var(--green-text); }
.stock-pills .sp.amber { background: var(--amber-soft); color: var(--amber-text); }
.stock-pills .sp.blue { background: var(--accent-soft); color: var(--accent-text); }
.stock-pills .sp.red { background: var(--red-soft); color: var(--red-text); }

/* ---------- Listes ---------- */
.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--border); }
.list-item:last-child { border-bottom: none; }
.list-item.clickable { cursor: pointer; }
.list-item.clickable:hover { background: var(--panel-2); }
.empty { padding: 36px 16px; text-align: center; color: var(--muted); }
.empty svg { width: 34px; height: 34px; color: var(--faint); margin: 0 auto 10px; }
.empty .t { color: var(--text); font-weight: 600; margin-bottom: 4px; }

/* ---------- Événements ---------- */
.ev { display: flex; gap: 11px; padding: 10px 16px; border-bottom: 1px solid var(--border); }
.ev:last-child { border-bottom: none; }
.ev .ic { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; flex: none; background: var(--panel-3); color: var(--muted); }
.ev .ic svg { width: 15px; height: 15px; }
.ev.action .ic { background: var(--green-soft); color: var(--green-text); }
.ev.success .ic { background: var(--accent-soft); color: var(--accent-text); }
.ev.warning .ic { background: var(--amber-soft); color: var(--amber-text); }
.ev.error .ic { background: var(--red-soft); color: var(--red-text); }
.ev .t { font-weight: 580; }
.ev.unread .t::after { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-left: 7px; vertical-align: middle; }

/* ---------- Toasts ---------- */
.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 200; display: flex; flex-direction: column; gap: 8px; width: min(380px, calc(100vw - 28px)); }
@media (max-width: 900px) { .toasts { bottom: 78px; right: 14px; } }
.toast {
  background: var(--panel-2); border: 1px solid var(--border-2); border-radius: 10px; box-shadow: var(--shadow);
  padding: 11px 13px; display: flex; gap: 10px; align-items: flex-start; animation: tin .18s ease;
}
.toast .ic { width: 20px; height: 20px; flex: none; margin-top: 1px; }
.toast.success .ic, .toast.action .ic { color: var(--green); }
.toast.error .ic { color: var(--red); }
.toast.warning .ic { color: var(--amber); }
.toast.info .ic { color: var(--accent); }
.toast .t { font-weight: 600; }
.toast .b { color: var(--muted); font-size: 12.5px; margin-top: 1px; }
.toast .acts { display: flex; gap: 6px; margin-top: 7px; }
@keyframes tin { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- Modale / panneau ---------- */
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 16px; animation: fin .12s ease; }
@keyframes fin { from { opacity: 0; } to { opacity: 1; } }
.modal { background: var(--panel); border: 1px solid var(--border-2); border-radius: 14px; box-shadow: var(--shadow); width: min(560px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; }
.modal.wide { width: min(900px, 100%); }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.modal-body { padding: 16px; overflow-y: auto; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 16px; border-top: 1px solid var(--border); }
.drawer-overlay { justify-content: flex-end; padding: 0; align-items: stretch; }
.drawer { background: var(--panel); border-left: 1px solid var(--border-2); width: min(560px, 100%); height: 100%; display: flex; flex-direction: column; animation: din .18s ease; }
@keyframes din { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.drawer .modal-body { flex: 1; }

/* ---------- Préparation (scan) ---------- */
.scanbar { display: flex; gap: 8px; }
.scanbar .search { flex: 1; }
.verify-item { display: grid; grid-template-columns: 130px 1fr; gap: 16px; padding: 14px; border-radius: 12px; border: 2px solid var(--border); background: var(--panel); }
.verify-item.ok { border-color: var(--green); background: linear-gradient(0deg, var(--green-soft), var(--green-soft)), var(--panel); }
.verify-item .big { width: 130px; height: 130px; border-radius: 10px; object-fit: cover; background: var(--panel-3); }
.verify-item .loc { display: inline-flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 650; color: var(--amber-text); }
.verify-item .loc svg { width: 16px; height: 16px; }
@media (max-width: 600px) { .verify-item { grid-template-columns: 96px 1fr; } .verify-item .big { width: 96px; height: 96px; } }
.flash { position: fixed; inset: 0; pointer-events: none; z-index: 300; animation: flash .55s ease forwards; }
.flash.ok { background: rgba(34,197,94,.28); }
.flash.err { background: rgba(239,68,68,.38); }
@keyframes flash { from { opacity: 1; } to { opacity: 0; } }
.step { display: flex; gap: 12px; align-items: flex-start; }
.step .n { width: 26px; height: 26px; border-radius: 50%; background: var(--panel-3); color: var(--muted); display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; }
.step.done .n { background: var(--green); color: #052e12; }
.scan-error { border: 1px solid rgba(239,68,68,.5); background: var(--red-soft); color: var(--red-text); border-radius: 10px; padding: 12px 14px; font-weight: 600; }
.success-screen { text-align: center; padding: 40px 16px; }
.success-screen .big-check { width: 84px; height: 84px; border-radius: 50%; background: var(--green-soft); color: var(--green); display: grid; place-items: center; margin: 0 auto 16px; }
.success-screen .big-check svg { width: 46px; height: 46px; }

.camera-box { position: relative; background: #000; border-radius: 12px; overflow: hidden; aspect-ratio: 4 / 3; }
.camera-box video { width: 100%; height: 100%; object-fit: cover; }
.camera-box .aim { position: absolute; inset: 18% 18%; border: 3px solid rgba(255,255,255,.85); border-radius: 14px; box-shadow: 0 0 0 999px rgba(0,0,0,.25); }

/* ---------- Login ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: radial-gradient(1200px 600px at 50% -20%, rgba(59,130,246,.12), transparent); }
.login-card { width: min(360px, 100%); background: var(--panel); border: 1px solid var(--border); border-radius: 16px; padding: 26px 22px; box-shadow: var(--shadow); }
.pin-dots { display: flex; justify-content: center; gap: 12px; margin: 18px 0; height: 16px; }
.pin-dots span { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--border-2); }
.pin-dots span.on { background: var(--accent); border-color: var(--accent); }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.keypad button { height: 56px; border-radius: 12px; border: 1px solid var(--border-2); background: var(--panel-2); font-size: 20px; font-weight: 600; cursor: pointer; }
.keypad button:hover { background: var(--panel-3); }
.keypad button:active { transform: scale(.97); }

/* ---------- Divers ---------- */
.spinner { width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.25); border-top-color: currentColor; border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; flex: none; }
.spinner.lg { width: 28px; height: 28px; border-width: 3px; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { background: linear-gradient(90deg, var(--panel-2), var(--panel-3), var(--panel-2)); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 8px; }
@keyframes sk { to { background-position: -200% 0; } }
.loading-page { display: grid; place-items: center; padding: 80px 0; color: var(--muted); gap: 12px; }
.divider { height: 1px; background: var(--border); margin: 14px 0; }
.kbd { font-family: ui-monospace, monospace; font-size: 11px; padding: 1px 5px; border-radius: 4px; border: 1px solid var(--border-2); background: var(--panel-2); color: var(--muted); }
.notice { border: 1px solid var(--border-2); background: var(--panel-2); border-radius: 10px; padding: 12px 14px; color: var(--muted); }
.notice.amber { border-color: rgba(245,158,11,.4); background: var(--amber-soft); color: var(--amber-text); }
.notice.blue { border-color: rgba(59,130,246,.4); background: var(--accent-soft); color: var(--accent-text); }
.notice.red { border-color: rgba(239,68,68,.4); background: var(--red-soft); color: var(--red-text); }
.notice.green { border-color: rgba(34,197,94,.4); background: var(--green-soft); color: var(--green-text); }
.section-title { display: flex; align-items: center; gap: 10px; margin: 26px 0 12px; }
.section-title h2 { font-size: 15px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.tab { padding: 9px 14px; color: var(--muted); font-weight: 560; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); border-bottom-color: var(--accent); }
.score { font-weight: 700; font-variant-numeric: tabular-nums; }
.score.high { color: var(--green-text); } .score.mid { color: var(--amber-text); } .score.low { color: var(--red-text); }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 6px 12px; font-size: 13px; }
.kv .k { color: var(--muted); }
.menu { position: absolute; z-index: 90; background: var(--panel-2); border: 1px solid var(--border-2); border-radius: 10px; box-shadow: var(--shadow); padding: 5px; min-width: 210px; }
.menu button { display: flex; align-items: center; gap: 9px; width: 100%; text-align: left; background: none; border: none; padding: 8px 10px; border-radius: 7px; cursor: pointer; color: var(--text); font-size: 13px; }
.menu button:hover { background: var(--panel-3); }
.menu button svg { width: 15px; height: 15px; color: var(--muted); }
.menu button.danger { color: var(--red-text); }
.inline-edit { background: transparent; border: 1px dashed transparent; border-radius: 6px; padding: 2px 6px; margin: -2px -6px; }
.inline-edit:hover { border-color: var(--border-2); }
.inline-edit:focus { border-color: var(--accent); outline: none; background: var(--panel); }

/* ---------- Impression ---------- */
.print-page { background: #fff; color: #000; min-height: 100vh; padding: 10mm; font: 12px/1.35 var(--font); }
.print-page .table th, .print-page .table td { color: #000; background: #fff; border-color: #ccc; }
.print-toolbar { position: sticky; top: 0; background: #f4f4f5; border-bottom: 1px solid #ddd; padding: 10px; display: flex; gap: 8px; align-items: center; margin: -10mm -10mm 10mm; color: #111; }
.print-toolbar .btn { background: #fff; color: #111; border-color: #ccc; }
.labels-a4 { display: grid; grid-template-columns: repeat(3, 63.5mm); grid-auto-rows: 38.1mm; gap: 0 2.5mm; }
.labels-thermal { display: flex; flex-direction: column; }
.qr-label { display: flex; gap: 3mm; align-items: center; padding: 2.5mm 3mm; overflow: hidden; border: 1px dashed #ddd; }
.labels-thermal .qr-label { width: 50mm; height: 30mm; page-break-after: always; break-after: page; border: none; }
.qr-label img { width: 24mm; height: 24mm; flex: none; }
.labels-thermal .qr-label img { width: 22mm; height: 22mm; }
.qr-label .code { font-size: 15px; font-weight: 800; letter-spacing: .02em; }
.qr-label .name { font-size: 9px; line-height: 1.2; max-height: 3.6em; overflow: hidden; }
.qr-label .loc { font-size: 9px; font-weight: 700; margin-top: 1mm; }
@media print {
  .print-toolbar { display: none; }
  .print-page { padding: 0; }
  .qr-label { border: none; }
  @page { margin: 8mm; }
}

/* ---------- Téléphone (en dernier : prime sur les règles ci-dessus) ---------- */
@media (max-width: 900px) {
  .page-head > div:first-child > h1 { display: none; }
  .page-head { margin-bottom: 12px; }
  .page-head > .grow { flex-basis: 100%; order: 3; }
}
@media (max-width: 600px) {
  .grid-auto-sm, .grid-auto { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .pcard .body { padding: 9px 10px 10px; gap: 6px; }
  .pcard .title { font-size: 12.5px; }
  .pcard .actions .qty-btn:not(.grow):not(.icon-btn) { display: none; }
  .scanbar { flex-wrap: wrap; }
  .scanbar .search { flex: 1 1 100%; }
  .scanbar > .btn { flex: 1; }
  .section-title { flex-wrap: wrap; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi .value { font-size: 24px; }
  .verify-item .big { width: 96px; height: 96px; }
}
