/* GesComptoir — styles de base (phase 1). Aucun style en ligne : la CSP l'interdit.
   Règles §12 : texte 16 px, boutons >= 48 px, vert/orange/rouge = sens uniquement. */
:root {
  --bg: #f5f6f8; --card: #fff; --text: #1d2433; --muted: #5b6577; --line: #d9dde6;
  --brand: #1f4fd8; --brand-dark: #173ca3; --ok: #1a7f37; --warn: #b45309; --bad: #c62828;
}
* { box-sizing: border-box; }
html { font-size: 16px; }
body { margin: 0; font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; background: var(--bg); color: var(--text); line-height: 1.5; }
a { color: var(--brand); }
header.top { background: var(--card); border-bottom: 1px solid var(--line); padding: .5rem 1rem; display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
header.top .brand { font-weight: 700; font-size: 1.25rem; color: var(--text); text-decoration: none; }
header.top nav { display: flex; gap: .5rem; flex-wrap: wrap; flex: 1; }
header.top nav a { padding: .75rem 1rem; min-height: 48px; display: inline-flex; align-items: center; text-decoration: none; border-radius: 8px; color: var(--text); }
header.top nav a:hover { background: var(--bg); }
header.top .right { display: flex; gap: .5rem; align-items: center; margin-inline-start: auto; }
main { max-width: 960px; margin: 1.5rem auto; padding: 0 1rem; }
main.narrow { max-width: 520px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 1.5rem; margin-bottom: 1.5rem; }
h1 { font-size: 1.6rem; margin: 0 0 1rem; } h2 { font-size: 1.2rem; margin: 0 0 .75rem; }
label { display: block; font-weight: 600; margin: 1rem 0 .25rem; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=date], input[type=number], select, textarea {
  width: 100%; min-height: 48px; padding: .6rem .75rem; font-size: 1rem; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--text);
}
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible { outline: 3px solid #9db7ff; outline-offset: 1px; }
.hint { color: var(--muted); font-size: .9rem; margin-top: .25rem; }
button, .btn { min-height: 48px; padding: .6rem 1.25rem; font-size: 1rem; font-weight: 600; border: 0; border-radius: 8px; background: var(--brand); color: #fff; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
button:hover, .btn:hover { background: var(--brand-dark); }
button.secondary { background: #fff; color: var(--text); border: 1px solid var(--line); }
button.secondary:hover { background: var(--bg); }
button.full { width: 100%; margin-top: 1.5rem; }
.alert { padding: .75rem 1rem; border-radius: 8px; margin-bottom: 1rem; border: 1px solid; }
.alert.ok { background: #e8f5ec; border-color: var(--ok); color: #14532d; }
.alert.bad { background: #fdeaea; border-color: var(--bad); color: #7f1d1d; }
.alert.warn { background: #fff4e5; border-color: var(--warn); color: #7c2d12; }
.field-error { color: var(--bad); font-size: .9rem; margin-top: .25rem; }
table { width: 100%; border-collapse: collapse; } th, td { text-align: start; padding: .6rem .5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: .9rem; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.tile { display: flex; align-items: center; justify-content: center; min-height: 110px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; font-size: 1.25rem; font-weight: 700; color: var(--muted); }
.badge { display: inline-block; padding: .1rem .6rem; border-radius: 999px; font-size: .85rem; font-weight: 600; border: 1px solid; }
.badge.ok { color: var(--ok); border-color: var(--ok); } .badge.bad { color: var(--bad); border-color: var(--bad); } .badge.warn { color: var(--warn); border-color: var(--warn); }
code, .secret { font-family: ui-monospace, Consolas, monospace; background: var(--bg); padding: .15rem .4rem; border-radius: 4px; word-break: break-all; }
.secret { display: block; padding: .75rem; font-size: 1.1rem; letter-spacing: .1em; }
.inline-form { display: inline-flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.inline-form select { width: auto; }
.row { display: flex; gap: 1rem; flex-wrap: wrap; } .row > * { flex: 1 1 220px; }
main.wide { max-width: 1240px; }
details.card summary { cursor: pointer; font-weight: 600; min-height: 48px; display: flex; align-items: center; }
.tabs .btn { min-width: 140px; }
.totals table th { font-weight: 600; } .totals .grand th, .totals .grand td { font-size: 1.6rem; font-weight: 700; border-bottom: 0; }
td form.inline-form { margin: 0; }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; margin: 0 0 1rem; }
.num { text-align: end; white-space: nowrap; }
.big { font-size: 2rem; margin: .25rem 0; } .big .badge { font-size: 1.5rem; padding: .2rem .9rem; }
.search input[type=search] { flex: 3 1 320px; }
.cat-root { margin-bottom: 1rem; } .cat-root ul { list-style: none; padding-inline-start: 2rem; margin: .5rem 0 0; } .cat-root li { margin-bottom: .5rem; }
a.tile { text-decoration: none; color: var(--text); } a.tile:hover { border-color: var(--brand); color: var(--brand); }

/* Étiquettes de rayon (60 x 38 mm) */
.labels { display: flex; flex-wrap: wrap; gap: 6mm; }
.label { width: 60mm; height: 38mm; border: 1px dashed var(--line); background: #fff; padding: 2mm; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; break-inside: avoid; }
.label-ref { font-weight: 700; font-size: 11pt; } .label-ref small { font-weight: 400; font-size: 8pt; }
.label-name { font-size: 8pt; line-height: 1.2; max-height: 2.4em; overflow: hidden; }
.label-meta { display: flex; justify-content: space-between; align-items: baseline; font-size: 8pt; } .label-price { font-size: 13pt; font-weight: 700; }
.label-bars { text-align: center; line-height: 0; } .label-bars svg { max-width: 100%; height: 11mm; }
.label-code { text-align: center; font-size: 7pt; font-family: ui-monospace, Consolas, monospace; }
@media print {
  header.top, .no-print, .alert { display: none !important; }
  body { background: #fff; } main { margin: 0; padding: 0; max-width: none; }
  .label { border: 0; }
}
label.inline-check { display: inline-flex; gap: .4rem; align-items: center; margin: 0; font-weight: 400; }

.part-photo { max-width: 240px; max-height: 240px; border-radius: 8px; border: 1px solid #ddd; display: block; margin: .5rem 0; }
.part-thumb { width: 32px; height: 32px; object-fit: cover; border-radius: 4px; vertical-align: middle; margin-inline-end: .4rem; }

.error-page { max-width: 520px; margin: 12vh auto; padding: 0 16px; text-align: center; }
.error-code { font-size: 64px; font-weight: 700; margin: 0; color: #888; }

.nav-group { position: relative; }
.nav-group > summary { padding: .75rem 1rem; min-height: 48px; display: inline-flex; align-items: center; cursor: pointer; border-radius: 8px; list-style: none; }
.nav-group > summary:hover { background: var(--bg); }
.nav-group .nav-menu { position: absolute; z-index: 20; inset-inline-start: 0; min-width: 14rem; background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: .25rem; display: flex; flex-direction: column; box-shadow: 0 4px 12px rgba(0,0,0,.12); }

[dir=rtl] .big, [dir=rtl] .c-line-total, [dir=rtl] .c-totals-table td.num, [dir=rtl] .c-sum strong { direction: ltr; unicode-bidi: isolate; }

.company-logo { max-width: 240px; max-height: 120px; object-fit: contain; display: block; margin: .5rem 0; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: .5rem; }

input[type=search] { width: 100%; min-height: 48px; padding: .6rem .75rem; font-size: 1rem; }
