/* MH-CUIR : administration */
@font-face { font-family: "Archivo"; src: url("../fonts/archivo-latin-wght-normal.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Libre Caslon Display"; src: url("../fonts/libre-caslon-display-latin-400-normal.woff2") format("woff2"); font-display: swap; }
:root {
  --noir: #0B0B0B; --encre: #1A1A1A; --rouge: #7A1424; --rouge-fonce: #5A0F1B; --rouge-pale: #F7E9EB;
  --fond: #F6F5F3; --pierre: #F1EFEC; --gris: #6B6B6B; --gris-clair: #9A9A9A; --trait: #E4E1DC; --trait-fort: #CFCAC2;
  --vert: #1E6B3A; --vert-pale: #E6F2EA; --ambre: #9A6200; --ambre-pale: #FFF4DC; --bleu: #1F3F7A; --bleu-pale: #E7EDF9;
  --violet: #4A2D86; --violet-pale: #EFEAFA;
  --font-ui: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-display: "Libre Caslon Display", Georgia, serif;
  --radius: 4px; --radius-lg: 6px;
  --shadow: 0 1px 2px rgba(20, 16, 12, .05);
  --shadow-lg: 0 10px 30px rgba(20, 16, 12, .14);
  --sidebar: 256px; --topbar: 60px;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--fond); color: var(--encre); font-family: var(--font-ui); font-size: 14.5px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
body.nav-open { overflow: hidden; }
a { color: inherit; text-underline-offset: .18em; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; }
:focus-visible { outline: 2px solid var(--rouge); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--gris); }
.small { font-size: .8125rem; }
.block { display: block; }
.strong { font-weight: 600; }
.nowrap { white-space: nowrap; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .8125rem; }
.t-right { text-align: right; }
.text-red { color: var(--rouge); }
.text-green { color: var(--vert); }
.text-amber { color: var(--ambre); }
.icon { flex: none; }

/* ------------------------------------------------------------ Structure */
.shell { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; display: flex; flex-direction: column; height: 100vh; overflow-y: auto; padding: 1rem .75rem 1.25rem; background: var(--noir); color: #fff; scrollbar-width: thin; scrollbar-color: #333 transparent; }
.sidebar-brand { display: flex; align-items: center; gap: .75rem; padding: .25rem .5rem 1.1rem; margin-bottom: .25rem; border-bottom: 1px solid #1F1F1F; color: #fff; text-decoration: none; font-family: var(--font-display); font-size: 1.3rem; line-height: 1.1; }
.sidebar-brand small { display: block; margin-top: .2rem; color: #8C8C8C; font-family: var(--font-ui); font-size: .6875rem; letter-spacing: .14em; text-transform: uppercase; }
.nav-section { margin: 1.15rem .75rem .35rem; color: #767676; font-size: .6875rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }
.sidebar-nav { flex: 1; }
.sidebar-nav ul { margin: 0; padding: 0; list-style: none; }
.sidebar-nav a { position: relative; display: flex; align-items: center; gap: .7rem; padding: .5rem .75rem; border-radius: var(--radius); color: #C9C9C9; text-decoration: none; transition: background .15s, color .15s; }
.sidebar-nav a:hover { background: #181818; color: #fff; }
.sidebar-nav a.is-active { background: #1E1E1E; color: #fff; font-weight: 600; }
.sidebar-nav a.is-active::before { content: ""; position: absolute; left: -.75rem; top: .45rem; bottom: .45rem; width: 3px; border-radius: 0 3px 3px 0; background: var(--rouge); }
.sidebar :focus-visible { outline-color: #fff; }
.nav-badge { min-width: 20px; margin-left: auto; padding: 0 6px; border-radius: 10px; background: var(--rouge); color: #fff; font-size: .72rem; font-weight: 700; line-height: 20px; text-align: center; }
.sidebar-foot { display: grid; gap: .15rem; margin-top: 1rem; padding: .9rem .5rem 0; border-top: 1px solid #1F1F1F; }
.sidebar-foot a { display: flex; align-items: center; gap: .6rem; padding: .45rem .25rem; color: #A8A8A8; font-size: .8125rem; text-decoration: none; }
.sidebar-foot a:hover { color: #fff; }
.main { display: flex; flex-direction: column; min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: .75rem; min-height: var(--topbar); padding: .55rem 1.75rem; background: rgba(255, 255, 255, .92); backdrop-filter: saturate(1.4) blur(8px); border-bottom: 1px solid var(--trait); }
.topbar-spacer { flex: 1; }
.topbar-search { position: relative; flex: 0 1 460px; }
.topbar-search .icon { position: absolute; left: .75rem; top: 50%; transform: translateY(-50%); color: var(--gris); pointer-events: none; }
.topbar-search input { width: 100%; height: 40px; padding: 0 3rem 0 2.35rem; border: 1px solid var(--trait); border-radius: var(--radius); background: var(--fond); }
.topbar-search input:focus { border-color: var(--noir); background: #fff; outline: none; box-shadow: 0 0 0 3px rgba(0, 0, 0, .06); }
.topbar-search kbd { position: absolute; right: .6rem; top: 50%; transform: translateY(-50%); padding: .05rem .4rem; border: 1px solid var(--trait-fort); border-radius: 3px; color: var(--gris); font: .72rem var(--font-ui); background: #fff; }
.topbar-user { display: flex; align-items: center; gap: .6rem; padding: .25rem .4rem; border-radius: var(--radius); text-decoration: none; }
.topbar-user:hover { background: var(--pierre); }
.topbar-user span { display: grid; line-height: 1.2; font-weight: 600; }
.topbar-user small { color: var(--gris); font-weight: 400; font-size: .75rem; }
.avatar { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--rouge); color: #fff; font-size: .8125rem; font-weight: 700; letter-spacing: .02em; }
.avatar--lg { flex: none; width: 60px; height: 60px; font-size: 1.15rem; }
.profile-head { display: flex; align-items: center; gap: 1rem; }
.profile-name-form { margin-top: 1.25rem; padding-top: 1.1rem; border-top: 1px solid var(--pierre); }
.profile-note, .panel-sub.profile-note { margin: 1rem 0 0; }
.access-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .5rem; margin: 0; padding: 0; list-style: none; }
.access-list li { display: flex; align-items: center; gap: .55rem; padding: .55rem .75rem; border: 1px solid var(--trait); border-radius: var(--radius); font-weight: 600; font-size: .875rem; }
.access-list .icon { color: var(--gris); }
.content { width: 100%; max-width: 1440px; margin: 0 auto; padding: 1.75rem 1.75rem 4rem; }

/* ------------------------------------------------------------ En-têtes de page */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 1rem; margin-bottom: 1.5rem; }
.page-head h1 { display: flex; align-items: center; flex-wrap: wrap; gap: .6rem; font-family: var(--font-display); font-size: 2.1rem; font-weight: 400; line-height: 1.15; letter-spacing: -.005em; }
.page-head p { margin: .3rem 0 0; }
.eyebrow { margin: 0 0 .35rem !important; color: var(--gris); font-size: .6875rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }
.crumb { display: flex; align-items: center; gap: .25rem; margin: 0 0 .35rem !important; font-size: .8125rem; }
.crumb a { display: inline-flex; align-items: center; gap: .25rem; color: var(--gris); text-decoration: none; }
.crumb a::before { content: "\2190"; }
.crumb a:hover { color: var(--noir); }
.head-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.subnav { display: flex; gap: 1.25rem; margin: -.25rem 0 1rem; font-size: .875rem; }

/* ------------------------------------------------------------ Panneaux */
.panel { margin-bottom: 1.25rem; padding: 1.35rem 1.5rem; background: #fff; border: 1px solid var(--trait); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.panel--flush { padding: 0; overflow-x: auto; }
.panel-title { margin-bottom: 1rem; font-size: 1rem; font-weight: 700; letter-spacing: -.005em; }
.panel-title small { margin-left: .35rem; color: var(--gris); font-size: .8125rem; font-weight: 400; }
.panel-sub { margin: -.6rem 0 1rem; color: var(--gris); font-size: .8125rem; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; padding: 1.15rem 1.5rem .35rem; }
.panel-head .panel-title { margin-bottom: .5rem; }
.panel-head--plain { padding: 0; }
.panel-head a { font-size: .8125rem; color: var(--gris); }
.panel-head a:hover { color: var(--noir); }
.stack > .panel:last-child { margin-bottom: 0; }
.stack-sm { display: grid; gap: .85rem; }
.grid-dash { display: grid; gap: 1.25rem; margin-bottom: 1.25rem; }
.grid-dash > .panel { margin: 0; }
@media (min-width: 1100px) { .grid-dash { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); } }
.grid-detail { display: grid; align-items: start; gap: 1.25rem; }
@media (min-width: 1100px) { .grid-detail { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); } }
.section-title { margin: 1.75rem 0 .75rem; color: var(--gris); font-size: .6875rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }
.section-title:first-child { margin-top: 0; }

/* ------------------------------------------------------------ Tableau de bord */
.todo-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(158px, 1fr)); gap: .85rem; margin-bottom: 1.5rem; }
.todo { display: flex; flex-direction: column; gap: .15rem; min-height: 124px; padding: 1rem 1.1rem; background: #fff; border: 1px solid var(--trait); border-radius: var(--radius-lg); box-shadow: var(--shadow); text-decoration: none; transition: border-color .15s, transform .15s, box-shadow .15s; }
a.todo:hover { border-color: var(--noir); box-shadow: var(--shadow-lg); transform: translateY(-1px); }
.todo-top { display: flex; align-items: center; justify-content: space-between; gap: .5rem; color: var(--gris); font-size: .8125rem; font-weight: 600; }
.todo-top .icon { color: var(--gris-clair); }
.todo-value { font-size: 2rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.15; }
.todo-cta { display: inline-flex; align-items: center; gap: .3rem; margin-top: auto; color: var(--gris); font-size: .8125rem; }
.todo--urgent { border-color: #E9C9CE; background: linear-gradient(180deg, var(--rouge-pale), #fff 70%); }
.todo--urgent .todo-value, .todo--urgent .todo-top .icon { color: var(--rouge); }
.todo--urgent .todo-cta { color: var(--rouge); font-weight: 600; }
.todo--calm .todo-value { color: var(--gris-clair); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: .85rem; margin-bottom: 1.25rem; }
.kpi { display: grid; gap: .15rem; padding: 1.1rem 1.2rem; background: #fff; border: 1px solid var(--trait); border-radius: var(--radius-lg); box-shadow: var(--shadow); text-decoration: none; }
a.kpi:hover { border-color: var(--noir); }
.kpi-label { color: var(--gris); font-size: .8125rem; font-weight: 600; }
.kpi-value { font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.25; }
.kpi-sub { color: var(--gris); font-size: .8125rem; }
.kpi--alert { border-left: 4px solid var(--rouge); }
.kpi--alert .kpi-value { color: var(--rouge); }
.trend { display: inline-flex; align-items: center; gap: .15rem; margin-right: .25rem; padding: 0 .4rem; border-radius: 10px; font-size: .75rem; font-weight: 700; }
.trend--up { background: var(--vert-pale); color: var(--vert); }
.trend--down { background: var(--rouge-pale); color: var(--rouge); }
.alerts { display: flex; flex-wrap: wrap; gap: .75rem; margin-bottom: 1.25rem; }
.alerts .flash { display: inline-flex; align-items: center; gap: .5rem; margin: 0; text-decoration: none; }
.chart-box { position: relative; height: 290px; }
.ranking { display: grid; margin: 0; padding: 0; list-style: none; }
.ranking li { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .6rem 0; border-bottom: 1px solid var(--pierre); }
.ranking li:last-child { border-bottom: 0; }
ol.ranking { counter-reset: rank; }
ol.ranking li > span:first-child::before { counter-increment: rank; content: counter(rank); display: inline-grid; place-items: center; width: 22px; height: 22px; margin-right: .6rem; border-radius: 50%; background: var(--pierre); color: var(--gris); font-size: .72rem; font-weight: 700; }
.quick-actions { display: flex; flex-wrap: wrap; gap: .5rem; }

/* ------------------------------------------------------------ Tableaux */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: .75rem 1rem; border-bottom: 1px solid var(--pierre); text-align: left; vertical-align: middle; }
.table th { background: #FAF9F7; color: var(--gris); font-size: .6875rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; white-space: nowrap; }
.table th:first-child, .table td:first-child { padding-left: 1.5rem; }
.table th:last-child, .table td:last-child { padding-right: 1.5rem; }
.table th.t-right, .table td.t-right { text-align: right; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: #FBFAF8; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tr[data-href] { cursor: pointer; }
.table--compact th, .table--compact td { padding: .5rem .75rem; }
.table .empty { padding: 3rem 1rem; color: var(--gris); text-align: center; }
.table tr.is-muted td { color: var(--gris-clair); }
.table tr.is-unread td:first-child { box-shadow: inset 3px 0 0 var(--rouge); }
.table tr.is-unread .strong { font-weight: 700; }
.cell-thumb { width: 68px; }
.thumb { width: 44px; height: 58px; object-fit: cover; border-radius: 3px; background: var(--pierre); }
.thumb--wide { width: 80px; height: 50px; }
.actions { white-space: nowrap; }
.actions form { display: inline; }
.row-actions { display: inline-flex; align-items: center; justify-content: flex-end; gap: .35rem; white-space: nowrap; }
.row-actions form { display: inline-flex; margin: 0; }
.badges { display: flex; flex-wrap: wrap; gap: .3rem; }
.badge { display: inline-flex; align-items: center; gap: .35rem; padding: .18rem .6rem; border-radius: 20px; background: var(--pierre); color: #444; font-family: var(--font-ui); font-size: .75rem; font-weight: 600; line-height: 1.35; white-space: nowrap; vertical-align: middle; }
.badge--new, .badge--pending { background: var(--ambre-pale); color: #6B4700; }
.badge--confirmed, .badge--accepted { background: var(--bleu-pale); color: var(--bleu); }
.badge--shipped { background: var(--violet-pale); color: var(--violet); }
.badge--delivered, .badge--done, .badge--ok { background: var(--vert-pale); color: var(--vert); }
.badge--cancelled, .badge--returned, .badge--refused, .badge--muted { background: #EEEDEB; color: #5A5A5A; }
.badge--red { background: var(--rouge); color: #fff; }
.badge--warn { background: var(--ambre-pale); color: #6B4700; }
.badge--danger { background: var(--rouge-pale); color: var(--rouge); }
.badge[class*="badge--"]::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.badge--red::before { display: none; }
.table .t-text { min-width: 260px; }
.stars-text { color: #B07D1A; font-size: 1rem; letter-spacing: .06em; white-space: nowrap; }
.stars-text-off { color: #D9D4CC; }
.indent { display: inline-block; margin-left: calc(var(--depth, 0) * 1.4rem); }
.indent[style*="--depth: 1"]::before, .indent[style*="--depth: 2"]::before { content: "\21B3\00a0"; color: var(--gris-clair); }
.swatch { display: inline-block; width: 16px; height: 16px; border-radius: 50%; background: var(--swatch, #ccc); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .2); vertical-align: -3px; }
.totals { display: grid; gap: .35rem; margin: 0; padding: 1rem 1.5rem 1.3rem; border-top: 1px solid var(--pierre); }
.totals div { display: flex; justify-content: space-between; gap: 1rem; }
.totals dt { color: var(--gris); }
.totals dd { margin: 0; font-variant-numeric: tabular-nums; }
.totals-final { margin-top: .4rem; padding-top: .7rem; border-top: 1px solid var(--trait); font-size: 1.15rem; font-weight: 700; }
.totals-final dt { color: inherit; }
.history { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.history li { position: relative; padding: 0 0 1rem 1.4rem; border-left: 1px solid var(--trait); margin-left: .35rem; }
.history li:last-child { padding-bottom: 0; border-left-color: transparent; }
.history li::before { content: ""; position: absolute; left: -5px; top: .35rem; width: 9px; height: 9px; border-radius: 50%; background: #fff; border: 2px solid var(--trait-fort); }
.history li:first-child::before { border-color: var(--rouge); background: var(--rouge); }
.history p { margin: .2rem 0 0; }
.note { padding: .75rem .9rem; background: var(--ambre-pale); border-left: 3px solid #E0A800; border-radius: 0 var(--radius) var(--radius) 0; }
.plain-list { padding-left: 1.1rem; }
.message-body { margin: 0; white-space: pre-line; font-size: 1rem; }
.address--default { font-weight: 600; }
.dl { display: grid; gap: .55rem; margin: 0; }
.dl div { display: grid; grid-template-columns: 110px 1fr; gap: .75rem; }
.dl dt { color: var(--gris); font-size: .8125rem; }
.dl dd { margin: 0; overflow-wrap: anywhere; }
.contact-actions { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: 1rem; }

/* ------------------------------------------------------------ Étapes de commande */
.stepper { display: grid; grid-template-columns: repeat(4, 1fr); margin: 0 0 1.25rem; padding: 1.1rem 1.5rem; list-style: none; background: #fff; border: 1px solid var(--trait); border-radius: var(--radius-lg); box-shadow: var(--shadow); counter-reset: step; }
.stepper li { position: relative; display: grid; justify-items: center; gap: .3rem; text-align: center; color: var(--gris-clair); font-size: .8125rem; }
.stepper li::before { counter-increment: step; content: counter(step); position: relative; z-index: 1; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: #fff; border: 1.5px solid var(--trait-fort); font-weight: 700; }
.stepper li::after { content: ""; position: absolute; top: 15px; left: calc(-50% + 15px); right: calc(50% + 15px); height: 1.5px; background: var(--trait-fort); }
.stepper li:first-child::after { display: none; }
.stepper li strong { color: inherit; font-weight: 600; }
.stepper li small { color: var(--gris); font-size: .75rem; }
.stepper li.is-done { color: var(--encre); }
.stepper li.is-done::before { content: "\2713"; background: var(--noir); border-color: var(--noir); color: #fff; }
.stepper li.is-done::after, .stepper li.is-current::after { background: var(--noir); }
.stepper li.is-current { color: var(--rouge); }
.stepper li.is-current::before { background: var(--rouge); border-color: var(--rouge); color: #fff; box-shadow: 0 0 0 4px var(--rouge-pale); }
.banner { display: flex; align-items: center; gap: .75rem; margin-bottom: 1.25rem; padding: .9rem 1.1rem; border-radius: var(--radius-lg); background: #EEEDEB; color: #444; }
.banner--danger { background: var(--rouge-pale); color: var(--rouge-fonce); }
.next-step { display: grid; gap: .85rem; }
.next-step .btn-primary { min-height: 46px; font-size: .95rem; }
.next-step-help { margin: 0; color: var(--gris); font-size: .8125rem; }
.other-actions { display: flex; flex-wrap: wrap; gap: .5rem; padding-top: .85rem; border-top: 1px solid var(--pierre); }

/* ------------------------------------------------------------ Formulaires */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-bottom: 1rem; }
.toolbar .input { width: auto; min-width: 170px; }
.toolbar input[type="search"] { min-width: 260px; }
.toolbar-search { position: relative; flex: 1 1 260px; max-width: 380px; }
.toolbar-search .icon { position: absolute; left: .7rem; top: 50%; transform: translateY(-50%); color: var(--gris); pointer-events: none; }
.toolbar-search .input { width: 100%; min-width: 0; padding-left: 2.2rem; }
.toolbar-reset { color: var(--gris); font-size: .8125rem; }
.toolbar-count { margin-left: auto; color: var(--gris); font-size: .8125rem; }
.inline-label { display: inline-flex; align-items: center; gap: .4rem; color: var(--gris); }
.form-grid { display: grid; gap: 0 1.25rem; }
@media (min-width: 800px) { .form-grid { grid-template-columns: 1fr 1fr; } }
.form-grid .panel-title { margin-top: .75rem; }
.form-grid .panel-title:first-of-type { margin-top: 0; }
.form-grid--single { grid-template-columns: 1fr !important; }
.field { margin-bottom: 1.05rem; }
.field--wide { grid-column: 1 / -1; }
.field-label { display: block; margin-bottom: .35rem; font-size: .8125rem; font-weight: 600; }
.field-label .input { margin-top: .35rem; font-weight: 400; }
.input { display: block; width: 100%; min-height: 42px; padding: .5rem .75rem; border: 1px solid var(--trait-fort); border-radius: var(--radius); background: #fff; transition: border-color .15s, box-shadow .15s; }
.input:hover { border-color: #B5AFA6; }
select.input { padding-right: 2rem; appearance: none; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23555' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right .7rem center; }
textarea.input { min-height: 90px; resize: vertical; line-height: 1.55; }
.input:focus { border-color: var(--noir); outline: none; box-shadow: 0 0 0 3px rgba(0, 0, 0, .07); }
.input--sm { min-height: 32px; padding: .2rem .5rem; font-size: .8125rem; }
select.input--sm { padding-right: 1.7rem; background-position: right .45rem center; }
.input--qty { width: 5.5rem; text-align: right; }
.input.is-zero { color: var(--rouge); border-color: #E6B3AD; }
input[type="color"].input { width: 90px; padding: .2rem; }
.has-error .input { border-color: var(--rouge); box-shadow: 0 0 0 3px var(--rouge-pale); }
.field-error { margin: .35rem 0 0; color: var(--rouge); font-size: .8125rem; font-weight: 600; }
.field-hint { margin: .35rem 0 0; color: var(--gris); font-size: .8125rem; }
.field-hint--top { margin: -.1rem 0 .6rem; }
.check { display: inline-flex; align-items: center; gap: .55rem; cursor: pointer; }
.check input, .table input[type="checkbox"], .radio-card input { width: 17px; height: 17px; accent-color: var(--noir); }
.checks { display: flex; flex-wrap: wrap; gap: .25rem 1.75rem; }
.checks .field { margin-bottom: .6rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; margin-top: .5rem; }
.form-narrow { max-width: 560px; }
.inline-form { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.inline-form .input:not(.input--qty) { width: auto; }
.radio-row { display: flex; flex-wrap: wrap; gap: .5rem; }
.radio-card { display: inline-flex; align-items: center; gap: .5rem; padding: .55rem .85rem; border: 1px solid var(--trait-fort); border-radius: var(--radius); cursor: pointer; font-weight: 600; }
.radio-card:has(input:checked) { border-color: var(--noir); box-shadow: inset 0 0 0 1px var(--noir); }
.sticky-actions { position: sticky; bottom: 0; z-index: 15; display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; margin: 1.25rem -1.75rem -4rem; padding: .85rem 1.75rem; background: rgba(255, 255, 255, .96); backdrop-filter: blur(6px); border-top: 1px solid var(--trait); box-shadow: 0 -6px 18px rgba(0, 0, 0, .04); }
.savebar { position: sticky; bottom: 1rem; z-index: 15; display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin-top: 1.25rem; padding: .7rem .8rem .7rem 1.2rem; background: rgba(255, 255, 255, .97); backdrop-filter: blur(6px); border: 1px solid var(--trait); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); }
.savebar-status { margin-right: auto; color: var(--gris); font-size: .8125rem; }
.savebar-status::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: .45rem; border-radius: 50%; background: var(--vert); vertical-align: 1px; }
form.is-dirty .savebar-status { color: var(--ambre); font-weight: 600; }
form.is-dirty .savebar-status::before { background: var(--ambre); }
.image-current { display: flex; align-items: center; gap: 1rem; margin-bottom: .6rem; }
.image-current img, .image-current video { max-width: 220px; max-height: 140px; border: 1px solid var(--trait); border-radius: 3px; background: var(--pierre); }
.danger-zone { display: flex; justify-content: flex-end; margin-top: 1rem; }
details.more { margin-top: .25rem; border-top: 1px solid var(--pierre); }
details.more > summary { display: flex; align-items: center; gap: .5rem; padding: .9rem 0 .2rem; color: var(--gris); font-weight: 600; cursor: pointer; list-style: none; }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::before { content: "+"; display: inline-grid; place-items: center; width: 20px; height: 20px; border: 1px solid var(--trait-fort); border-radius: 50%; font-size: .85rem; line-height: 1; }
details.more[open] > summary::before { content: "\2212"; }
details.more > .more-body { padding-top: 1rem; }
details.more--bare { margin: 0; border: 0; }
details.more--bare > summary { padding-top: 0; }
.savebar--inset { position: static; margin: 0; border-width: 1px 0 0; border-radius: 0 0 var(--radius-lg) var(--radius-lg); box-shadow: none; }
.photos-help { margin: 1.5rem 0 0; }
.steps-hint + details.more--bare { margin-top: 0; }
.panel > .steps-hint { margin-bottom: 1rem; }

/* Interrupteurs (cases à cocher de visibilité) */
.switches { display: grid; gap: .1rem; }
.switches .field { margin: 0; }
.switches .check { display: flex; justify-content: space-between; flex-direction: row-reverse; width: 100%; padding: .65rem 0; border-bottom: 1px solid var(--pierre); font-weight: 600; }
.switches .field:last-child .check { border-bottom: 0; }
.switches .check input { appearance: none; position: relative; flex: none; width: 38px; height: 22px; margin: 0; border-radius: 11px; background: var(--trait-fort); cursor: pointer; transition: background .2s; }
.switches .check input::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, .25); transition: transform .2s; }
.switches .check input:checked { background: var(--vert); }
.switches .check input:checked::after { transform: translateX(16px); }
.switches .check input:focus-visible { outline: 2px solid var(--rouge); outline-offset: 2px; }
.switch-hint { display: block; color: var(--gris); font-size: .75rem; font-weight: 400; }

/* Écrans d'un vendeur (fiche utilisateur) */
.checklist { min-width: 0; margin: .25rem 0 1.4rem; padding: 0; border: 0; }
.checklist[hidden] { display: none; }
.checklist legend { display: flex; align-items: center; gap: .75rem; width: 100%; padding: 0; }
.checklist > .field-hint { margin: 0 0 .7rem; }
.checklist-grid { display: grid; gap: .5rem; }
@media (min-width: 640px) { .checklist-grid { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); } }
.checklist-item { display: flex; align-items: flex-start; gap: .65rem; padding: .7rem .85rem; border: 1px solid var(--trait); border-radius: var(--radius); background: #fff; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.checklist-item:hover { border-color: var(--trait-fort); }
.checklist-item:has(input:checked) { border-color: var(--noir); box-shadow: inset 0 0 0 1px var(--noir); }
.checklist-item input { flex: none; width: 17px; height: 17px; margin: .1rem 0 0; accent-color: var(--noir); }
.checklist-item strong { display: block; font-size: .875rem; }
.checklist-item small { display: block; margin-top: .1rem; color: var(--gris); font-size: .75rem; line-height: 1.4; }

/* Nouvelle commande (saisie par l'équipe) */
.order-picker { display: grid; gap: .75rem; align-items: end; padding: 1.1rem 1.5rem; border-bottom: 1px solid var(--pierre); background: #FAF9F7; }
@media (min-width: 700px) { .order-picker { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto auto; } }
.order-picker .field-label { margin: 0; }
.order-picker .input--qty { width: 5rem; }
.order-lines td { vertical-align: middle; }
.order-lines .input--qty { display: inline-block; }
.line-warning { display: block; margin-top: .2rem; color: var(--rouge); font-size: .75rem; font-weight: 600; }
.line-warning[hidden], [data-other-city][hidden], [data-lines-empty][hidden] { display: none; }
.lines-empty { margin: 0; padding: 2rem 1.5rem; color: var(--gris); text-align: center; }
.totals-note { margin: -.6rem 1.5rem 1.2rem; color: var(--gris); font-size: .75rem; }
.source-tag { display: inline-block; padding: 0 .4rem; border-radius: 9px; background: var(--pierre); color: var(--encre); font-size: .6875rem; font-weight: 600; }

/* ------------------------------------------------------------ Produit */
.product-layout { display: grid; align-items: start; gap: 1.25rem; }
@media (min-width: 1100px) { .product-layout { grid-template-columns: minmax(0, 1fr) 340px; } }
.product-layout .panel { margin-bottom: 1.25rem; }
.product-layout aside .panel:last-child { margin-bottom: 0; }
.product-summary { display: flex; align-items: center; gap: .9rem; }
.product-summary img { width: 54px; height: 72px; object-fit: cover; border-radius: 3px; background: var(--pierre); }
.steps-hint { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; margin: 0 0 1.25rem; padding: .85rem 1.1rem; list-style: none; background: #fff; border: 1px dashed var(--trait-fort); border-radius: var(--radius-lg); color: var(--gris); font-size: .8125rem; counter-reset: hint; }
.steps-hint li { display: inline-flex; align-items: center; gap: .45rem; }
.steps-hint li::before { counter-increment: hint; content: counter(hint); display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--pierre); color: var(--encre); font-size: .72rem; font-weight: 700; }
.steps-hint li.is-current { color: var(--encre); font-weight: 600; }
.steps-hint li.is-current::before { background: var(--noir); color: #fff; }
.generator { display: grid; gap: 1rem; margin: 1rem 0 1.5rem; padding: 1.1rem; background: #FAF9F7; border: 1px dashed var(--trait-fort); border-radius: var(--radius-lg); }
.generator fieldset { margin: 0; padding: 0; border: 0; }
.generator legend { margin-bottom: .45rem; font-weight: 700; }
.generator .btn { justify-self: start; }
.check-grid { display: flex; flex-wrap: wrap; gap: .45rem; }
.check-grid .check { padding: .35rem .7rem; border: 1px solid var(--trait); border-radius: 20px; background: #fff; font-size: .875rem; }
.check-grid .check:has(input:checked) { border-color: var(--noir); box-shadow: inset 0 0 0 1px var(--noir); }
.check-grid--tight { gap: .35rem; }
.check-grid--tight .check { min-width: 3.4rem; justify-content: center; }
.upload-row { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.upload-row .input { width: auto; flex: 1 1 220px; }
.dropzone { position: relative; display: grid; place-items: center; gap: .35rem; padding: 1.6rem 1rem; border: 1.5px dashed var(--trait-fort); border-radius: var(--radius-lg); background: #FAF9F7; color: var(--gris); text-align: center; cursor: pointer; transition: border-color .15s, background .15s; }
.dropzone:hover, .dropzone.is-over { border-color: var(--noir); background: #fff; }
.dropzone strong { color: var(--encre); }
.dropzone input[type="file"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.dropzone-previews { display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem; margin-top: .4rem; }
.dropzone-previews img { width: 48px; height: 64px; object-fit: cover; border-radius: 3px; }
.dropzone-previews video { width: 160px; height: 90px; object-fit: cover; border-radius: 3px; background: var(--noir); }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .9rem; margin: .75rem 0 0; padding: 0; list-style: none; }
.photo { position: relative; padding: .4rem; background: #FAF9F7; border: 1px solid var(--trait); border-radius: var(--radius-lg); }
.photo:first-child { border-color: var(--noir); }
.photo:first-child::after { content: "Vignette"; position: absolute; right: .7rem; top: .7rem; padding: .1rem .45rem; border-radius: 10px; background: var(--noir); color: #fff; font-size: .6875rem; font-weight: 600; }
.photo img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 3px; background: var(--pierre); }
.photo-drag { position: absolute; left: .7rem; top: .7rem; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: #fff; box-shadow: var(--shadow); cursor: grab; }
.photo-actions { display: flex; align-items: center; gap: .3rem; margin-top: .4rem; }
.photo-actions .input { flex: 1; min-width: 0; }
.sortable-ghost { opacity: .4; }
.stock-pill { display: inline-flex; align-items: center; gap: .35rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.stock-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--vert); }
.stock-pill--low::before { background: #E0A800; }
.stock-pill--out { color: var(--rouge); }
.stock-pill--out::before { background: var(--rouge); }

/* ------------------------------------------------------------ Onglets, boutons, messages */
.tabs { display: flex; gap: .25rem; margin-bottom: 1rem; overflow-x: auto; border-bottom: 1px solid var(--trait); scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { display: inline-flex; align-items: center; gap: .35rem; padding: .6rem .85rem; border-bottom: 2px solid transparent; color: var(--gris); text-decoration: none; font-weight: 600; white-space: nowrap; margin-bottom: -1px; }
.tabs a:hover { color: var(--noir); }
.tabs a b { padding: 0 .45rem; border-radius: 10px; background: var(--pierre); color: #333; font-size: .72rem; }
.tabs a.is-active { color: var(--noir); border-bottom-color: var(--noir); }
.tabs a.is-active b { background: var(--noir); color: #fff; }
.tabs a.is-alert b { background: var(--rouge); color: #fff; }
.tab-panel[hidden] { display: none; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; min-height: 40px; padding: .45rem 1rem; border: 1px solid var(--trait-fort); border-radius: var(--radius); background: #fff; color: var(--encre); font-weight: 600; line-height: 1.2; text-decoration: none; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, color .15s; }
.btn:hover { border-color: var(--noir); }
.btn-primary { background: var(--noir); border-color: var(--noir); color: #fff; }
.btn-primary:hover { background: #2B2B2B; border-color: #2B2B2B; }
.btn-accent { background: var(--rouge); border-color: var(--rouge); color: #fff; }
.btn-accent:hover { background: var(--rouge-fonce); border-color: var(--rouge-fonce); }
.btn-whatsapp { background: #1F8A4C; border-color: #1F8A4C; color: #fff; }
.btn-whatsapp:hover { background: #176E3C; border-color: #176E3C; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: #fff; border-color: var(--trait); }
.btn-danger-ghost { border-color: transparent; background: transparent; color: var(--rouge); }
.btn-danger-ghost:hover { border-color: var(--rouge); background: #fff; }
.btn-sm { min-height: 32px; padding: .25rem .65rem; font-size: .8125rem; }
.btn-block { width: 100%; }
.btn.is-loading { position: relative; color: transparent !important; pointer-events: none; }
.btn.is-loading::after { content: ""; position: absolute; width: 16px; height: 16px; border: 2px solid currentColor; border-color: #999 #999 #999 transparent; border-radius: 50%; animation: spin .7s linear infinite; }
.btn-primary.is-loading::after, .btn-accent.is-loading::after, .btn-whatsapp.is-loading::after { border-color: #fff #fff #fff transparent; }
@keyframes spin { to { transform: rotate(360deg); } }
.link-btn { padding: 0; border: 0; background: none; color: var(--gris); font-size: .8125rem; text-decoration: underline; cursor: pointer; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: var(--radius); background: none; color: inherit; cursor: pointer; text-decoration: none; }
.icon-btn:hover { background: var(--pierre); }
.icon-btn--danger { color: var(--rouge); }
.icon-btn--wa { color: #1F8A4C; }
.flash { margin: 0 0 1rem; padding: .75rem 1rem; border-left: 3px solid var(--noir); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
.flash--error { border-left-color: var(--rouge); background: #FCEDEB; color: #7A1E16; }
.flash--success { border-left-color: var(--vert); background: #EAF5EE; color: #174F2C; }
.toasts { position: fixed; right: 1.25rem; top: calc(var(--topbar) + .75rem); z-index: 80; display: grid; gap: .5rem; width: min(400px, calc(100vw - 2rem)); }
.toasts .flash { display: flex; align-items: flex-start; gap: .6rem; margin: 0; padding: .85rem .9rem .85rem 1rem; box-shadow: var(--shadow-lg); animation: toast-in .25s ease-out; }
.toasts .flash span { flex: 1; }
.toasts .flash.is-leaving { opacity: 0; transform: translateY(-6px); transition: opacity .25s, transform .25s; }
.toast-close { display: grid; place-items: center; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 50%; background: none; color: inherit; opacity: .6; cursor: pointer; }
.toast-close:hover { opacity: 1; background: rgba(0, 0, 0, .06); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } }
.pager { display: flex; align-items: center; justify-content: center; gap: 1rem; margin-top: 1.25rem; color: var(--gris); }
.empty-state { display: grid; justify-items: center; gap: .5rem; padding: 3rem 1rem; color: var(--gris); text-align: center; }
.empty-state .icon { color: var(--trait-fort); }
.empty-state strong { color: var(--encre); font-size: 1rem; }

/* ------------------------------------------------------------ Recherche globale */
.search-group { margin-bottom: 1.25rem; }
.search-group h2 { display: flex; align-items: center; gap: .5rem; }
.result-list { margin: 0; padding: 0; list-style: none; }
.result-list li + li { border-top: 1px solid var(--pierre); }
.result-list a { display: flex; align-items: center; gap: .9rem; padding: .75rem 1.5rem; text-decoration: none; }
.result-list a:hover { background: #FBFAF8; }
.result-list .grow { flex: 1; min-width: 0; }

/* ------------------------------------------------------------ Connexion et erreurs */
.auth-page { display: grid; place-items: center; min-height: 100vh; padding: 1.5rem; background: var(--noir) radial-gradient(ellipse at top, #1d1d1d, var(--noir) 60%); }
.auth-card { width: min(420px, 100%); padding: 2.5rem 2.25rem 2.25rem; background: #fff; border-radius: var(--radius-lg); box-shadow: 0 30px 80px rgba(0, 0, 0, .45); }
.auth-logo { width: 88px; height: 88px; margin: 0 auto 1rem; }
.auth-card h1 { margin-bottom: .35rem; font-family: var(--font-display); font-size: 1.9rem; font-weight: 400; text-align: center; }
.auth-sub { margin: 0 0 1.5rem; color: var(--gris); font-size: .875rem; text-align: center; }
.auth-foot { margin: 1.5rem 0 0; color: var(--gris-clair); font-size: .75rem; text-align: center; }
.error-box { max-width: 520px; margin: 3rem auto; text-align: center; }
.error-code { margin: 0; color: var(--rouge); font-family: var(--font-display); font-size: 4.5rem; line-height: 1; }
.error-box h1 { margin: .5rem 0; font-family: var(--font-display); font-weight: 400; }

/* ------------------------------------------------------------ Mobile et tablette */
.only-mobile { display: none; }
.nav-backdrop { display: none; }
.card-only { display: none; }
@media (max-width: 1100px) {
  .topbar-search kbd { display: none; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; z-index: 60; width: 280px; transform: translateX(-100%); transition: transform .25s ease; }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .nav-backdrop { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(0, 0, 0, .4); }
  .only-mobile { display: inline-grid; }
  .hide-sm { display: none !important; }
  .topbar { padding: .5rem 1rem; gap: .5rem; }
  .topbar-search { flex: 1 1 auto; }
  .content { padding: 1.1rem 1rem 3.5rem; }
  .page-head { align-items: flex-start; margin-bottom: 1.1rem; }
  .page-head h1 { font-size: 1.7rem; }
  .panel { padding: 1.1rem 1.1rem; }
  .panel.panel--flush { padding: 0; }
  .toolbar .inline-label { flex: 1 1 calc(50% - .25rem); min-width: 0; }
  .toolbar .inline-label .input { flex: 1 1 auto; min-width: 0; width: 100%; }
  .panel-head { padding: 1rem 1.1rem .35rem; }
  .totals { padding: 1rem 1.1rem 1.2rem; }
  .sticky-actions { margin: 1.25rem -1rem -3.5rem; padding: .75rem 1rem; }
  .savebar { bottom: .5rem; padding: .6rem .7rem; }
  .savebar-status { flex: 1 1 100%; }
  .savebar .btn { flex: 1 1 auto; }
  .form-row { grid-template-columns: 1fr; }
  .toolbar .input, .toolbar input[type="search"], .toolbar-search { flex: 1 1 100%; max-width: none; min-width: 0; width: 100%; }
  .toolbar .btn { flex: 1 1 auto; }
  .toolbar-count { margin-left: 0; }
  .stepper { padding: 1rem .5rem; }
  .stepper li { font-size: .75rem; }
  .stepper li small { display: none; }
  .todo { min-height: 0; }
  .toasts { top: auto; bottom: 1rem; right: 1rem; }
  .head-actions { width: 100%; }
  .head-actions .btn { flex: 1 1 auto; }
}
@media (max-width: 760px) {
  /* Tableaux transformés en cartes empilées */
  .table--cards thead { display: none; }
  .table--cards, .table--cards tbody { display: block; }
  .table--cards tr { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: .25rem .75rem; padding: .95rem 1.1rem; border-bottom: 1px solid var(--pierre); }
  .table--cards td { display: block; grid-column: 2 / 4; padding: 0 !important; border: 0; text-align: left !important; }
  .table--cards td.cell-thumb { grid-column: 1; grid-row: 1 / span 6; width: auto; }
  .table--cards td.card-main { grid-column: 2; grid-row: 1; font-size: .95rem; }
  .table--cards td.card-side { grid-column: 3; grid-row: 1; text-align: right !important; }
  .table--cards tr:not(:has(.cell-thumb)) { grid-template-columns: minmax(0, 1fr) auto; }
  .table--cards tr:not(:has(.cell-thumb)) td { grid-column: 1 / 3; }
  .table--cards tr:not(:has(.cell-thumb)) td.card-main { grid-column: 1; }
  .table--cards tr:not(:has(.cell-thumb)) td.card-side { grid-column: 2; }
  .table--cards td[data-label]:not([data-label=""])::before { content: attr(data-label) " : "; color: var(--gris); font-size: .8125rem; }
  .table--cards td.card-hide { display: none; }
  .table--cards .card-only { display: inline; }
  .table--cards td.empty { grid-column: 1 / -1; padding: 2rem 0 !important; text-align: center !important; }
  .table--cards .row-actions { justify-content: flex-start; margin-top: .45rem; }
  .table--cards .card-main .muted.block { font-size: .8125rem; }
}

/* ------------------------------------------------------------ Impression */
@media print {
  .sidebar, .topbar, .toasts, .head-actions, .savebar, .sticky-actions, .danger-zone { display: none !important; }
  .shell { display: block; }
  body { background: #fff; }
}
