/* Polices, variables, fond de page et en-tete: static/base.css (partage avec livraison.css). */

.page-wrap {
  padding: 20px clamp(16px, 5vw, 56px) max(42px, calc(24px + env(safe-area-inset-bottom)));
  display: grid;
  gap: 16px;
}

/* Messages flash: static/base.css. */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.stat-card {
  background: linear-gradient(135deg, #fefbf2 0%, #fff 100%);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  animation: rise 320ms ease both;
}

.stat-card h2 {
  margin: 0 0 8px;
  font-size: 0.9rem;
  text-transform: uppercase;
  color: var(--muted);
}

.stat-card p {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
}

.stat-card.warning {
  border-color: #f1d197;
  background: #fff8e8;
}

/* .panel: static/base.css. */

.import-form,
.filters-grid,
.item-form-grid {
  display: grid;
  gap: 10px;
}

.filters-grid,
.item-form-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.item-form-grid {
  align-items: start;
}

.item-form-grid-basic {
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 0.65fr) minmax(0, 1.35fr);
}

.item-form-grid > * {
  align-self: start;
}

.filters-grid-compact {
  grid-template-columns: minmax(240px, 2fr) minmax(150px, 1.2fr) minmax(150px, 1.2fr) minmax(120px, 0.8fr);
  align-items: end;
  gap: 8px;
}

.filter-field {
  display: grid;
  gap: 4px;
}

.filter-field-wide {
  grid-column: auto;
}

.filter-label {
  font-size: 0.72rem;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  font-weight: 700;
}

.filter-field input,
.filter-field select {
  min-height: 40px;
}

.custom-dropdown {
  position: relative;
}

.custom-dropdown.is-open {
  z-index: var(--z-dropdown);
}

.dropdown-toggle {
  min-height: 40px;
  text-align: left;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--line);
  position: relative;
  padding-right: 34px;
}

.dropdown-toggle::after {
  content: "▾";
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 0.85rem;
}

.custom-dropdown.is-open .dropdown-toggle {
  border-color: #9fd8c8;
  box-shadow: 0 0 0 2px rgba(18, 107, 95, 0.16);
}

.dropdown-panel {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: var(--z-dropdown-panel);
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
}

.dropdown-panel[hidden] {
  display: none;
}

.dropdown-search {
  min-height: 36px;
  padding: 8px 10px;
}

.dropdown-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  max-height: 260px;
  overflow-y: auto;
}

.dropdown-option {
  width: 100%;
  text-align: left;
  border: 0;
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 8px 10px;
  cursor: pointer;
  font-weight: 500;
}

.dropdown-option:hover,
.dropdown-option:focus-visible {
  background: #eef8f4;
  outline: none;
}

.dropdown-option.is-selected {
  background: #dff3ec;
  color: #0f5a4f;
}

.dropdown-empty {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.switch-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  background: #fff;
}

textarea {
  grid-column: 1 / -1;
}

/* button (couleur, largeur auto, transitions, focus, .btn-secondary,
   .danger, disabled): static/base.css. */

.delete-x {
  width: 30px;
  min-width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  color: #fff;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border: 1px solid color-mix(in srgb, var(--danger), #000 12%);
  font-weight: 800;
  line-height: 1;
}

.delete-x svg {
  width: 15px;
  height: 15px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.delete-x:hover {
  filter: brightness(0.95);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(10, 37, 64, 0.14);
}

.delete-x:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.75);
  outline: 2px solid color-mix(in srgb, var(--danger), #fff 40%);
  outline-offset: 2px;
}

.switch-row {
  display: flex;
  align-items: center;
  gap: 8px;
  grid-column: span 2;
  cursor: pointer;
}

.switch-row.switch-row-compact {
  display: grid;
  gap: 4px;
  grid-column: auto;
  align-items: start;
}

.switch-row input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch-ui {
  width: 44px;
  height: 24px;
  border-radius: 999px;
  background: #cfd8d3;
  position: relative;
  transition: background 180ms ease;
}

.switch-ui::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ffffff;
  transition: transform 180ms ease;
}

.switch-row input:checked + .switch-ui {
  background: var(--accent);
}

.switch-row input:checked + .switch-ui::after {
  transform: translateX(20px);
}

.drop-zone {
  border: 2px dashed #9ecbc0;
  border-radius: 12px;
  padding: 16px;
  display: grid;
  gap: 8px;
  background: #f3fbf8;
}

.drop-zone input[type="file"] {
  border: none;
  padding: 0;
}

.profile-panel {
  display: grid;
  gap: 12px;
}

.profiles-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.profile-card,
.profile-empty {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: #fff;
}

.profile-card {
  display: grid;
  gap: 8px;
  align-content: start;
  position: relative;
}

.profile-delete-form {
  position: absolute;
  top: 6px;
  right: 6px;
  margin: 0;
}

.btn-profile-delete {
  width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, filter 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.btn-profile-delete:hover {
  background: var(--danger);
  color: #fff;
}

.profile-card h3 {
  margin: 0;
}

.profile-lock-hint {
  margin-bottom: 0;
  color: #0f5a4f;
  font-size: 0.82rem;
}

.profile-password-field input {
  min-height: 36px;
}

.profile-icon {
  font-size: 1.8rem;
  line-height: 1;
  margin: 0;
}

.profile-create-wrap {
  display: grid;
  gap: 10px;
}

.profile-create-wrap .btn-secondary {
  max-width: 240px;
}

.profile-create-form {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: #fff;
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.profile-create-form button {
  grid-column: 1 / -1;
}

.is-hidden {
  display: none;
}

.master-gate {
  max-width: 560px;
  margin: 10px auto;
  border-radius: 18px;
  border-color: #b9d6db;
  background: linear-gradient(148deg, #f7fdfd 0%, #ffffff 46%, #f2f7fa 100%);
  box-shadow: 0 14px 28px rgba(22, 65, 72, 0.14);
  animation: rise 320ms ease both;
}

.master-gate-head {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
}

.master-gate-head h1 {
  margin: 0;
  font-family: "Futurastd", "Avenir Next", sans-serif;
  font-size: clamp(1.3rem, 2.4vw, 1.8rem);
  letter-spacing: 0.02em;
}

.master-gate-kicker {
  margin: 0;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: #176f7b;
  font-weight: 700;
}

.master-gate-form {
  display: grid;
  gap: 10px;
}

/* Choix de destination sur la page de connexion (Inventaire / Livraison) */
.destination-choix {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 0 0 6px;
  padding: 0;
  border: 0;
}

.destination-choix legend {
  grid-column: 1 / -1;
  padding: 0 0 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.destination-option {
  display: block;
  cursor: pointer;
}

.destination-option input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.destination-carte {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px 10px;
  text-align: center;
  background: #fff;
  border: 2px solid var(--line);
  border-radius: 12px;
  transition: border-color .15s, background .15s;
}

.destination-icone {
  font-size: 28px;
  line-height: 1;
}

.destination-nom {
  font-weight: 600;
}

.destination-option input:checked + .destination-carte {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.destination-option input:focus-visible + .destination-carte {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* .table-wrap (conteneur + focus): static/base.css, partage avec .liv-table-wrap. */

.table-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.table-panel-head h2 {
  margin: 0;
}

.export-csv-btn {
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  background: #fff;
  white-space: nowrap;
  transition: background-color 160ms ease, border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.export-csv-btn:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(10, 37, 64, 0.12);
}

.export-csv-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.table-meta {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.92rem;
}

/* table/th/td: static/base.css, partage avec .liv-table th/td. */

.table-panel tbody tr.return-target-flash {
  animation: return-target-flash 1.35s ease-out 1;
}

@keyframes return-target-flash {
  0% {
    background-color: rgba(34, 143, 157, 0.34);
  }
  65% {
    background-color: rgba(34, 143, 157, 0.18);
  }
  100% {
    background-color: transparent;
  }
}

.sort-link {
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
}

.sort-link:hover {
  color: var(--accent);
}

td small {
  display: block;
  color: var(--muted);
  margin-top: 4px;
}

.movement-details-cell {
  min-width: 280px;
  width: 34%;
}

.movement-note-empty {
  color: var(--muted);
}

.movement-note-expand {
  width: 100%;
}

.movement-note-summary {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  cursor: pointer;
  list-style: none;
}

.movement-note-summary::-webkit-details-marker {
  display: none;
}

.movement-note-preview {
  min-width: 0;
  flex: 1;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;
}

.movement-note-toggle {
  flex-shrink: 0;
  margin-top: 1px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 8px;
  line-height: 1.2;
}

.movement-note-expand[open] .movement-note-toggle {
  color: #0f7c67;
}

.movement-note-expand[open] .movement-note-toggle::after {
  content: " moins";
}

.movement-note-expand:not([open]) .movement-note-toggle::after {
  content: " plus";
}

.movement-note-full {
  margin-top: 6px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fbfc;
  word-break: break-word;
}

.movement-note-line {
  display: block;
  padding: 3px 0;
  border-bottom: 1px solid var(--line);
}

.movement-note-line:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.movement-note-line:first-child {
  padding-top: 0;
}

.low-row {
  background: #fff7ed;
}

.actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 360px;
  opacity: 0;
  transform: translateX(4px);
  pointer-events: none;
  transition: opacity 140ms ease, transform 140ms ease;
}

.table-panel tbody tr:hover .actions,
.table-panel tbody tr:focus-within .actions {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

.table-panel tbody tr {
  transition: background-color 140ms ease;
}

.table-panel tbody tr:hover,
.table-panel tbody tr:focus-within {
  background-color: rgba(34, 143, 157, 0.08);
}

.actions-main {
  display: grid;
  gap: 6px;
  flex: 1;
}

.actions-side {
  display: grid;
  gap: 6px;
  justify-items: end;
  align-content: center;
}

.actions-delete {
  margin: 0;
}

.actions-cell {
  vertical-align: top;
}

.qty-cell,
.location-cell,
.actions-cell {
  vertical-align: top;
}

.qty-cell > .qty-allocation-list,
.location-cell > .location-pill-list,
.actions-cell .actions-main {
  margin-top: 0;
}

.row-actions-cell {
  width: 62px;
  min-width: 62px;
}

.row-actions-cell .actions-side {
  justify-items: center;
}

.icon-btn {
  width: 30px;
  min-width: 30px;
  height: 30px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  text-decoration: none;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--accent);
  font-weight: 700;
  line-height: 1;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, filter 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.icon-btn:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(10, 37, 64, 0.12);
}

.movement-inline {
  display: grid;
  grid-template-columns: 88px 68px 1fr 56px;
  gap: 4px;
}

.qty-cell {
  vertical-align: top;
  min-width: 210px;
}

.qty-total-cell {
  vertical-align: top;
  min-width: 96px;
}

.qty-adjuster {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
}

.qty-btn {
  width: 28px;
  min-width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--accent);
  font-weight: 700;
  line-height: 1;
  padding: 0;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, filter 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.qty-btn:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(10, 37, 64, 0.12);
}

.qty-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.qty-value {
  min-width: 34px;
  text-align: center;
  font-size: 0.95rem;
  font-weight: 700;
}

.qty-status {
  display: block;
  margin-top: 4px;
  min-height: 1.1em;
  color: var(--muted);
  font-size: 0.76rem;
}

.qty-status.is-active {
  color: var(--accent);
}

.actions-loan {
  align-items: flex-start;
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.loan-inline-form {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(120px, 1fr) 136px 82px;
  gap: 4px;
  align-items: start;
}

.loan-inline-form input,
.loan-inline-form button {
  min-height: 34px;
  padding: 7px 9px;
}

.loan-inline-form .loan-seller-dropdown .dropdown-toggle {
  min-height: 34px;
  padding: 7px 28px 7px 9px;
}

.loan-inline-form .loan-seller-dropdown {
  align-self: start;
}

.loan-inline-form .loan-seller-dropdown.is-open {
  z-index: var(--z-dropdown);
}

.loan-inline-form .loan-seller-dropdown .dropdown-panel {
  z-index: var(--z-dropdown-panel);
}

.loan-combobox {
  position: relative;
}

.loan-client-last-suggestion {
  min-height: 0;
  margin-top: 4px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.25;
  text-align: left;
  text-decoration: underline;
  text-decoration-style: dashed;
  text-underline-offset: 2px;
  cursor: pointer;
  justify-self: start;
}

.loan-client-last-suggestion:hover,
.loan-client-last-suggestion:focus-visible {
  color: var(--accent);
}

.loan-client-last-suggestion[hidden] {
  display: none;
}

.loan-combobox-panel {
  position: fixed;
  z-index: var(--z-dropdown-combobox);
  margin: 0;
  padding: 4px;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
  max-height: 240px;
  overflow-y: auto;
  min-width: 140px;
}

.loan-combobox-panel[hidden] {
  display: none;
}

.loan-combobox-panel .dropdown-option {
  padding: 6px 8px;
}

.loan-combobox-empty {
  padding: 6px 8px;
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.loan-hover-only {
  transition: opacity 140ms ease, transform 140ms ease, max-height 140ms ease;
}

@media (hover: hover) {
  .loan-hover-only {
    opacity: 0;
    pointer-events: none;
    max-height: 0;
    overflow: hidden;
    transform: translateY(-2px) scale(0.97);
    transition-delay: 0ms;
  }

  .table-panel tbody tr:hover .loan-hover-only,
  .table-panel tbody tr:focus-within .loan-hover-only {
    opacity: 1;
    pointer-events: auto;
    max-height: 160px;
    overflow: visible;
    transform: translateY(0) scale(1);
    transition-delay: 1200ms;
  }
}

@media (hover: none) {
  .loan-hover-only {
    opacity: 1;
    pointer-events: auto;
    max-height: none;
    overflow: visible;
    transform: none;
  }
}

.loan-inline-form button[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}

.loan-active-list {
  margin-top: 6px;
  display: grid;
  gap: 4px;
}

.loan-pill-form {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 3px 4px 3px 10px;
}

.loan-pill-meta {
  font-size: 0.82rem;
  color: var(--danger);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.loan-return-btn {
  width: auto;
  min-width: 72px;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.78rem;
  font-weight: 700;
}

.loan-entry {
  display: grid;
  gap: 4px;
}

.loan-pill-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.loan-edit-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  min-width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 999px;
  font-size: 0.9rem;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  line-height: 1;
}

.loan-edit-toggle:hover {
  color: var(--accent);
  border-color: var(--line);
  background: var(--accent-soft);
}

.loan-edit-form[hidden] {
  display: none;
}

.loan-edit-form {
  display: grid;
  grid-template-columns: minmax(100px, 1fr) minmax(100px, 1fr) 140px auto;
  gap: 4px;
  align-items: center;
  padding: 6px;
  background: var(--accent-soft);
  border-radius: 8px;
  border: 1px solid var(--line);
}

.loan-edit-form input {
  min-height: 32px;
  padding: 5px 8px;
}

.loan-edit-actions {
  display: flex;
  gap: 4px;
}

.loan-edit-actions button {
  min-height: 32px;
  padding: 5px 10px;
  font-size: 0.78rem;
  white-space: nowrap;
}

.btn-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.form-intro {
  margin-top: -4px;
  color: var(--muted);
}

.form-subnote {
  margin: 0 0 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.form-meta-pill {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.82rem;
  color: var(--muted);
}

.item-form-layout {
  display: grid;
  gap: 14px;
}

.form-panel {
  max-width: 1120px;
  margin-inline: auto;
}

.form-section {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fffcf5;
  padding: 12px;
  margin: 0;
}

.form-section legend {
  color: var(--accent);
  font-weight: 700;
  padding: 0 6px;
}

.allocation-editor {
  display: grid;
  gap: 12px;
}

.allocation-editor-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.allocation-total {
  min-width: 110px;
  display: grid;
  gap: 2px;
  justify-items: end;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.allocation-total span {
  font-size: 0.78rem;
  color: var(--muted);
}

.allocation-total output {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--accent);
}

.allocation-list {
  display: grid;
  gap: 10px;
}

.allocation-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 140px auto;
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.allocation-field {
  min-width: 0;
}

.allocation-field-qty input {
  text-align: center;
}

.allocation-remove-btn {
  min-height: 44px;
}

.allocation-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.item-form-grid-tight {
  margin-top: 12px;
}

.qty-total {
  display: grid;
  gap: 2px;
}

.qty-total strong {
  font-size: 1.05rem;
}

.qty-total span {
  font-size: 0.78rem;
  color: var(--muted);
}

.qty-allocation-list,
.location-pill-list {
  display: grid;
  gap: 8px;
}

.allocation-combined-cell {
  vertical-align: top;
  min-width: 380px;
}

.allocation-combined-list {
  display: grid;
  gap: 6px;
}

.allocation-combined-card {
  position: relative;
  z-index: var(--z-base-raised);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 6px 8px;
  transform: none;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.allocation-combined-card.is-dropdown-active {
  z-index: var(--z-dropdown-active-card);
}

@media (hover: hover) {
  .allocation-combined-card {
    transition-delay: 0ms;
  }

  .table-panel tbody tr:hover .allocation-combined-card,
  .table-panel tbody tr:focus-within .allocation-combined-card {
    transform: scale(1.02);
    box-shadow: 0 8px 20px rgba(15, 23, 32, 0.12);
    transition-delay: 1200ms;
  }
}

.allocation-combined-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

.inline-location-form {
  margin: 0;
  min-width: 0;
  flex: 1;
}

.inline-location-form .dropdown-toggle {
  min-height: 26px;
  padding: 4px 24px 4px 8px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 700;
}

.inline-location-form .dropdown-toggle::after {
  right: 8px;
}

.inline-location-form .dropdown-panel {
  z-index: var(--z-dropdown-panel);
  padding: 8px;
  gap: 6px;
}

.inline-location-form .dropdown-search {
  min-height: 32px;
  padding: 6px 8px;
}

.inline-location-form .dropdown-option {
  padding: 6px 8px;
  font-size: 0.84rem;
}

.allocation-combined-top strong {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.allocation-chip {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #f8fbfc;
  color: var(--muted);
  font-size: 0.74rem;
  white-space: nowrap;
}

.allocation-combined-top .qty-adjuster {
  margin-left: auto;
  flex-shrink: 0;
}

.allocation-combined-card .qty-status {
  margin-top: 1px;
  min-height: 0;
}

.allocation-combined-card .qty-status:empty {
  display: none;
}

.allocation-combined-card .loan-inline-form {
  margin-top: 2px;
  grid-template-columns: minmax(90px, 1fr) minmax(90px, 1fr) 118px 72px;
  gap: 3px;
}

.allocation-combined-card .loan-inline-form input,
.allocation-combined-card .loan-inline-form button {
  min-height: 30px;
  padding: 6px 8px;
}

.allocation-combined-card .loan-active-list {
  margin-top: 5px;
  gap: 3px;
}

.allocation-combined-card .loan-pill-form {
  padding: 2px 4px 2px 8px;
}


.qty-allocation,
.location-pill,
.location-action-group {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 8px 10px;
}

.qty-allocation-head,
.location-action-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.qty-allocation-head span,
.location-action-head span,
.location-pill span,
.cell-muted {
  font-size: 0.78rem;
  color: var(--muted);
}

.location-pill {
  display: grid;
  gap: 2px;
}

.cell-muted {
  display: block;
}

.location-action-group .loan-active-list {
  margin-top: 8px;
}

.location-action-group .loan-inline-form {
  margin-top: 6px;
}

.form-field {
  display: grid;
  gap: 6px;
}

.form-field span {
  font-size: 0.9rem;
  color: var(--muted);
}

.item-form-layout .form-field input:not([type="hidden"]),
.item-form-layout .form-field select,
.item-form-layout .dropdown-toggle,
.item-form-layout .dropdown-search {
  min-height: 44px;
}

.field-hint {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.3;
}

.settings-header {
  display: grid;
  gap: 4px;
  margin-bottom: 14px;
}

.settings-header h2 {
  margin: 0;
}

.settings-form {
  display: grid;
  gap: 14px;
}

.settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(280px, 1fr);
  gap: 14px;
  align-items: start;
}

.settings-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfcfd 100%);
}

.settings-card-head {
  display: grid;
  gap: 6px;
}

.settings-card-head h3 {
  margin: 0;
  font-size: 1rem;
}

.settings-switch {
  padding: 12px;
  border: 1px solid #d8e6ea;
  border-radius: 12px;
  background: #f7fbfc;
}

.settings-fields {
  display: grid;
  gap: 12px;
}

.settings-fields-double {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.settings-field-full {
  grid-column: 1 / -1;
}

.settings-card-security {
  position: sticky;
  top: 12px;
}

.settings-actions {
  justify-content: flex-start;
  flex-wrap: wrap;
  padding-top: 4px;
}

.settings-actions .page-btn,
.settings-actions button {
  width: auto;
  min-width: 180px;
  text-align: center;
}

.size-suggest-wrap {
  border: 1px dashed #b8c4bf;
  border-radius: 10px;
  padding: 8px;
  background: #f8fbfa;
}

.size-suggest-title {
  margin: 0 0 6px;
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 600;
}

.size-suggest-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.size-suggest-chip {
  width: auto;
  min-height: 30px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid #9fd8c8;
  background: #eaf8f3;
  color: #0f5a4f;
  font-size: 0.84rem;
  font-weight: 600;
}

.size-suggest-chip:hover,
.size-suggest-chip:focus-visible {
  border-color: #6abda8;
  background: #dcf3eb;
}

.readonly-field input[readonly] {
  background: #f7f7f5;
  color: #4b5563;
}

.form-field.full-width {
  grid-column: 1 / -1;
}

.form-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 10px;
  align-items: center;
}

.form-actions-sticky {
  position: sticky;
  bottom: 8px;
  z-index: var(--z-sticky);
  background: rgba(255, 253, 248, 0.92);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  justify-content: space-between;
  backdrop-filter: blur(4px);
}

.form-actions-sticky .page-btn,
.form-actions-sticky button {
  width: auto;
  min-width: 140px;
  text-align: center;
}

.item-nav-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  min-width: 0;
}

.item-nav-group .page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-width: 0;
  height: 42px;
  padding: 0 14px;
  white-space: nowrap;
}

.item-nav-page-picker {
  display: inline-flex;
  align-items: center;
  min-width: 76px;
}

.item-nav-page-picker select {
  box-sizing: border-box;
  height: 42px;
  min-width: 76px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  padding: 0 28px 0 10px;
  font: inherit;
  font-weight: 600;
}

.item-nav-meta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  height: 42px;
  min-width: 64px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 600;
  white-space: nowrap;
}

.pagination-bar {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.pagination-bar-top {
  margin-top: 0;
  margin-bottom: 10px;
  justify-content: flex-end;
}

.page-btn {
  text-decoration: none;
  border: 1px solid var(--line);
  color: var(--text);
  background: #fff;
  border-radius: 10px;
  padding: 8px 10px;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, filter 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.page-btn:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(10, 37, 64, 0.12);
}

.page-btn.disabled {
  opacity: 0.45;
  pointer-events: none;
}

.page-info {
  color: var(--muted);
  padding: 0 4px;
}

.page-jump-input {
  -moz-appearance: textfield;
  appearance: textfield;
  width: 3.6rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  text-align: center;
  padding: 2px 4px;
  margin: 0 2px;
  vertical-align: baseline;
}

.page-jump-input:focus {
  outline: 2px solid var(--accent, #3b82f6);
  outline-offset: 1px;
}

.page-jump-input::-webkit-inner-spin-button,
.page-jump-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.toast-stack {
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: var(--z-toast);
  display: grid;
  gap: 10px;
  width: min(360px, calc(100vw - 24px));
  pointer-events: none;
}

.toast {
  display: grid;
  grid-template-columns: 10px 1fr;
  align-items: center;
  gap: 10px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(5px);
  box-shadow: 0 10px 26px rgba(31, 41, 55, 0.18);
  color: var(--text);
  padding: 11px 12px;
  opacity: 0;
  transform: translateY(12px) scale(0.98);
  transition: opacity 180ms ease, transform 220ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.toast-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.toast p {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.35;
  font-weight: 600;
}

.toast-success {
  border-color: #8ad4c0;
}

.toast-success .toast-dot {
  background: #0f7c67;
}

.toast-error {
  border-color: #efb2ad;
}

.toast-error .toast-dot {
  background: #b42318;
}

.unsaved-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  background: rgba(15, 23, 32, 0.46);
  display: grid;
  place-items: center;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  overflow-y: auto;
}

.unsaved-modal {
  width: min(460px, 100%);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 16px 40px rgba(15, 23, 32, 0.24);
  display: grid;
  gap: 12px;
}

.unsaved-modal h3 {
  margin: 0;
  font-size: 1rem;
}

.unsaved-modal p {
  margin: 0;
  color: var(--muted);
}

.unsaved-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

/* Pre-validation du numero d'article */
.item-dup-flag {
  width: auto;
  min-height: 32px;
  margin-top: 2px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  border-radius: 10px;
  border: 1px solid #f0c98a;
  background: #fef6e7;
  color: #7a4a05;
  font-size: 0.84rem;
  font-weight: 600;
  text-align: left;
}

.item-dup-flag[hidden] {
  display: none;
}

.item-dup-flag:hover,
.item-dup-flag:focus-visible {
  border-color: #e0ab55;
  background: #fdeed1;
}

.item-dup-flag.is-exact {
  border-color: #eab0a8;
  background: #fdecea;
  color: #8a1f16;
}

.item-dup-flag.is-exact:hover,
.item-dup-flag.is-exact:focus-visible {
  border-color: #dd8d81;
  background: #fbdfdb;
}

/* Neutralise .form-field span (couleur/taille des libelles de champ). */
.form-field .item-dup-flag span {
  color: inherit;
  font-size: inherit;
}

.form-field .item-dup-flag .item-dup-flag-icon {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: #7a4a05;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1;
}

.form-field .item-dup-flag.is-exact .item-dup-flag-icon {
  background: #8a1f16;
}

.item-dup-modal {
  width: min(680px, 100%);
}

.item-dup-modal .unsaved-modal-actions button {
  width: auto;
  min-width: 150px;
}

.item-dup-groups {
  display: grid;
  gap: 14px;
  max-height: min(52vh, 460px);
  overflow-y: auto;
  padding-right: 2px;
}

.item-dup-group {
  display: grid;
  gap: 8px;
}

.item-dup-group-title {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.item-dup-card {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  align-items: start;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfdfe;
}

.item-dup-card.is-exact {
  border-color: #eab0a8;
  background: #fef8f7;
}

.item-dup-thumb {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  overflow: hidden;
  background: #eef3f5;
  display: grid;
  place-items: center;
}

.item-dup-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.item-dup-thumb.is-empty {
  font-size: 0.6rem;
  line-height: 1.2;
  text-align: center;
  color: var(--muted);
  padding: 4px;
}

.item-dup-body {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.item-dup-head {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.item-dup-number {
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}

.item-dup-kind {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background: var(--accent-soft);
  color: #0b5a63;
}

.item-dup-kind.is-exact {
  background: #fbdfdb;
  color: #8a1f16;
}

.item-dup-kind.is-source {
  background: #eef3f5;
  color: var(--muted);
  text-transform: none;
  letter-spacing: 0;
  font-weight: 600;
}

.item-dup-name {
  margin: 0;
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}

.item-dup-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
}

.item-dup-chip {
  font-size: 0.78rem;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.item-dup-chip strong {
  color: var(--text);
  font-weight: 600;
}

.item-dup-edit {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--accent);
  font-size: 1rem;
  text-decoration: none;
}

.item-dup-edit:hover,
.item-dup-edit:focus-visible {
  border-color: var(--accent);
  background: var(--accent-soft);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 960px) {
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filters-grid,
  .item-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .item-form-grid-basic {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  }

  .item-form-grid-basic > :first-child {
    grid-column: 1 / -1;
  }

  .settings-grid {
    grid-template-columns: 1fr;
  }

  .settings-card-security {
    position: static;
  }

  .filters-grid-compact {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .filters-grid-compact .filter-field-wide {
    grid-column: 1 / -1;
  }

  .dropdown-panel {
    position: static;
    margin-top: 6px;
    box-shadow: none;
  }

  .form-field.full-width {
    grid-column: 1 / -1;
  }

  .form-actions-sticky {
    bottom: 6px;
  }

  .item-nav-group {
    flex: 1;
  }

  .movement-details-cell {
    min-width: 220px;
    width: 32%;
  }
}

/* En-tete mobile (site-header/nav-group/nav-link): static/base.css. */

@media (max-width: 640px) {
  .stats-grid,
  .filters-grid,
  .item-form-grid {
    grid-template-columns: 1fr;
  }

  .item-form-grid-basic > :first-child {
    grid-column: auto;
  }

  .profile-create-form {
    grid-template-columns: 1fr;
  }

  .movement-details-cell {
    min-width: 180px;
    width: 38%;
  }

  .movement-note-toggle {
    font-size: 0.72rem;
    padding: 2px 7px;
  }

  .filters-grid-compact {
    gap: 10px;
  }

  .filters-grid-compact .filter-field-wide,
  .filters-grid-compact .switch-row-compact {
    grid-column: 1;
  }

  .dropdown-list {
    max-height: 220px;
  }

  .form-section {
    padding: 10px;
  }

  .settings-card {
    padding: 12px;
  }

  .settings-fields-double {
    grid-template-columns: 1fr;
  }

  .settings-actions {
    display: grid;
    gap: 8px;
  }

  .settings-actions .page-btn,
  .settings-actions button {
    width: 100%;
    min-width: 0;
  }

  .form-subnote {
    gap: 6px;
  }

  .switch-row {
    grid-column: 1;
  }

  .movement-inline {
    grid-template-columns: 1fr;
  }

  .qty-cell {
    min-width: 0;
  }

  .qty-total-cell {
    min-width: 0;
  }

  .allocation-combined-cell {
    min-width: 0;
  }

  .allocation-combined-top {
    flex-wrap: wrap;
    row-gap: 6px;
  }

  .inline-location-form {
    flex-basis: 100%;
  }

  .row-actions-cell .actions-side {
    justify-items: start;
  }

  .qty-adjuster {
    gap: 8px;
    padding: 4px 6px;
  }

  .qty-btn {
    width: 44px;
    min-width: 44px;
    height: 44px;
  }

  .qty-value {
    min-width: 30px;
  }

  .qty-status {
    margin-top: 3px;
  }

  .loan-inline-form {
    grid-template-columns: 1fr;
  }

  .loan-pill-form {
    border-radius: 12px;
    align-items: stretch;
    flex-direction: column;
    padding: 8px;
  }

  .loan-pill-meta {
    white-space: normal;
  }

  .loan-return-btn {
    width: 100%;
  }

  .actions {
    display: grid;
    min-width: 0;
    gap: 8px;
    opacity: 1;
    transform: none;
    pointer-events: auto;
  }

  .actions-delete {
    margin-left: 0;
    justify-self: start;
  }

  .actions-side {
    justify-items: start;
  }

  .pagination-bar {
    gap: 6px;
  }

  .page-btn {
    font-size: 0.9rem;
    padding: 7px 9px;
  }

  .form-actions-sticky {
    position: static;
    padding: 0;
    border: none;
    background: transparent;
    backdrop-filter: none;
    display: grid;
    gap: 8px;
  }

  .form-actions-sticky .page-btn,
  .form-actions-sticky button {
    width: 100%;
    min-width: 0;
  }

  .item-nav-group {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
    gap: 8px;
  }

  .item-nav-page-picker {
    width: 100%;
  }

  .item-nav-page-picker select {
    width: 100%;
  }

  .item-nav-meta {
    width: 100%;
  }

  .toast-stack {
    right: max(10px, env(safe-area-inset-right));
    bottom: max(10px, env(safe-area-inset-bottom));
    width: min(340px, calc(100vw - 20px));
  }

  .master-gate {
    margin: 0;
    border-radius: 14px;
  }

  .unsaved-modal {
    padding: 14px;
  }

  .unsaved-modal-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .unsaved-modal-actions .btn-secondary {
    width: 100%;
  }

  .item-dup-card {
    grid-template-columns: 44px 1fr auto;
    gap: 8px;
  }

  .item-dup-thumb {
    width: 44px;
    height: 44px;
  }

  .item-dup-groups {
    max-height: 46dvh;
  }

  .inventory-table,
  .inventory-table tbody,
  .inventory-table tr,
  .inventory-table td {
    display: block;
    width: 100%;
  }

  .inventory-table thead {
    display: none;
  }

  .inventory-table tbody {
    display: grid;
    gap: 12px;
  }

  .inventory-table tbody tr {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
  }

  .inventory-table td {
    display: grid;
    grid-template-columns: minmax(100px, 36%) minmax(0, 1fr);
    gap: 8px;
    padding: 10px 12px;
  }

  .inventory-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
  }

  .inventory-table .item-name-cell,
  .inventory-table .allocation-combined-cell,
  .inventory-table .actions-cell {
    grid-template-columns: 1fr;
  }

  .inventory-table .item-name-cell::before,
  .inventory-table .allocation-combined-cell::before,
  .inventory-table .actions-cell::before {
    margin-bottom: -2px;
  }

  .inventory-table .item-name-wrap,
  .inventory-table .allocation-combined-list,
  .inventory-table .actions-side {
    min-width: 0;
  }

  .inventory-table .row-actions-cell {
    min-width: 0;
  }

  .inventory-table .row-actions-cell .actions-side {
    display: flex;
    gap: 10px;
  }

  .inventory-table .icon-btn,
  .inventory-table .delete-x {
    width: 44px;
    min-width: 44px;
    height: 44px;
  }
}

@media (hover: none) {
  .actions {
    opacity: 1;
    transform: none;
    pointer-events: auto;
  }
}

@media (max-width: 480px) {
  .site-brand {
    gap: 8px;
  }

  .site-brand-text {
    font-size: 0.78rem;
    letter-spacing: 0.06em;
  }

  .panel {
    padding: 12px;
  }

  .form-section {
    border-radius: 10px;
  }

  th,
  td {
    padding: 8px;
    font-size: 0.9rem;
  }

  .dropdown-toggle,
  .dropdown-search,
  .dropdown-option {
    font-size: 0.95rem;
  }

  .form-meta-pill {
    font-size: 0.76rem;
    padding: 3px 8px;
  }

  .toast {
    grid-template-columns: 8px 1fr;
    gap: 8px;
    border-radius: 10px;
    padding: 10px;
  }

  .toast p {
    font-size: 0.88rem;
  }

  .qty-adjuster {
    gap: 6px;
    padding: 3px 5px;
  }

  .qty-btn {
    width: 44px;
    min-width: 44px;
    height: 44px;
  }

  .qty-status {
    font-size: 0.72rem;
  }

  .item-nav-meta {
    font-size: 0.8rem;
  }

  .movement-details-cell {
    min-width: 160px;
    width: 40%;
  }

  .movement-note-preview {
    -webkit-line-clamp: 1;
    line-clamp: 1;
  }

  .movement-note-full {
    padding: 7px 8px;
    font-size: 0.86rem;
  }
}

@media (max-width: 360px) {
  .site-brand-text {
    display: none;
  }

  .pagination-bar {
    display: grid;
    grid-template-columns: 1fr;
  }

  .page-btn {
    text-align: center;
  }

  .form-section legend {
    font-size: 0.92rem;
  }

  .dropdown-panel {
    padding: 8px;
  }

  .movement-details-cell {
    min-width: 144px;
  }

  .movement-note-toggle {
    font-size: 0.68rem;
    padding: 2px 6px;
  }

  .field-hint {
    font-size: 0.74rem;
  }

  .item-nav-meta {
    min-width: 0;
  }

  .toast-stack {
    right: 8px;
    bottom: 8px;
    width: calc(100vw - 16px);
  }

  .qty-adjuster {
    gap: 5px;
  }

  .qty-value {
    min-width: 26px;
    font-size: 0.88rem;
  }
}

/* ===== Management pages: Suppliers / Locations ===== */

.btn-sm {
  width: auto;
  padding: 6px 14px;
  font-size: 0.88rem;
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.muted-text {
  color: var(--muted);
  font-size: 0.92rem;
  margin: 0 0 8px;
}

.lookup-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.lookup-page-header h2 {
  margin: 0;
}

.lookup-count-badge {
  display: inline-block;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 0.85rem;
  font-weight: 700;
  vertical-align: middle;
}

.lookup-section {
  border-top: 1px solid var(--line);
  padding-top: 16px;
  margin-top: 16px;
}

.lookup-section h3 {
  margin: 0 0 10px;
  font-size: 1rem;
  color: var(--text);
}

.merge-form {
  display: block;
}

.merge-fields {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.merge-field-group {
  display: grid;
  gap: 4px;
  flex: 1;
  min-width: 160px;
}

.merge-arrow {
  font-size: 1.5rem;
  color: var(--muted);
  padding-bottom: 6px;
  flex-shrink: 0;
  align-self: flex-end;
}

.merge-submit-wrap {
  display: grid;
  gap: 4px;
  flex-shrink: 0;
}

.merge-submit-spacer {
  visibility: hidden;
  display: block;
  line-height: 1;
}

.merge-submit-wrap button {
  width: auto;
  white-space: nowrap;
}

.add-inline-form {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.add-inline-form input[type="text"] {
  flex: 1;
}

.add-inline-form button {
  width: auto;
  white-space: nowrap;
}

.lookup-table {

  .lookup-check-th,
  .lookup-check-td {
    width: 36px;
    text-align: center;
    vertical-align: middle;
    padding-left: 6px;
    padding-right: 2px;
  }

  .merge-check-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
  }

  .merge-check-label input[type="checkbox"] {
    width: 16px;
    min-height: 16px;
    padding: 0;
    border-radius: 4px;
    cursor: pointer;
    accent-color: var(--accent);
  }

  width: 100%;
}

.lookup-count-th,
.lookup-actions-th {
  white-space: nowrap;
}

.lookup-count-th {
  width: 120px;
  text-align: right;
}

.lookup-actions-th {
  width: 120px;
  text-align: right;
}

.lookup-count-td {
  text-align: right;
  color: var(--muted);
  vertical-align: middle;
}

.lookup-count-total {
  opacity: 0.6;
  font-size: 0.85em;
}

.lookup-actions-td {
  text-align: right;
  vertical-align: middle;
}

.merge-reason {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.merge-reason.reason-alias {
  background: #eef8f4;
  border-color: #9fd8c8;
  color: #0f5a4f;
}

.merge-reason.reason-ocr {
  background: #f0f7ff;
  border-color: #a8c9f0;
  color: #1f4f80;
}

.merge-reason.reason-accent {
  background: #f5f0ff;
  border-color: #ccb8f2;
  color: #4d2d80;
}

.merge-reason.reason-typo {
  background: #fff7ed;
  border-color: #f2d3a2;
  color: #8a4a16;
}

.lookup-actions-td form {
  display: inline;
}

.inline-rename-form {
  display: flex;
  gap: 8px;
  align-items: center;
}

.rename-input {
  flex: 1;
  padding: 6px 10px;
  font-size: 0.92rem;
}

.inline-rename-form button {
  width: auto;
  white-space: nowrap;
  flex-shrink: 0;
}

.dropdown-count {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 400;
  margin-left: 8px;
}

@media (max-width: 640px) {
  .merge-fields {
    flex-direction: column;
    gap: 10px;
  }

  .merge-arrow {
    align-self: auto;
    padding-bottom: 0;
    font-size: 1.2rem;
  }

  .merge-field-group {
    width: 100%;
  }

  .merge-submit-wrap {
    width: 100%;
  }

  .merge-submit-wrap button,
  .add-inline-form button {
    width: 100%;
  }

  .lookup-page-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .inline-rename-form {
    flex-wrap: wrap;
  }

  .rename-input {
    min-width: 0;
  }
}

/* ===== Item image uploader + hover preview ===== */

.item-image-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  align-items: start;
}

.item-image-field {
  display: grid;
}

.item-image-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.item-image-dropzone {
  min-height: 96px;
  width: 120px;
  display: grid;
  place-items: center;
  gap: 4px;
  padding: 12px;
  border: 2px dashed #8ec5cf;
  border-radius: 14px;
  background:
    radial-gradient(circle at top left, rgba(34, 143, 157, 0.12), transparent 36%),
    linear-gradient(180deg, #fafdff 0%, #eef7f8 100%);
  text-align: center;
  cursor: pointer;
  transition: border-color 140ms ease, transform 140ms ease, box-shadow 140ms ease, background 140ms ease;
  flex-shrink: 0;
}

.item-image-dropzone:hover,
.item-image-dropzone:focus-visible,
.item-image-dropzone.is-dragover {
  border-color: var(--accent);
  background:
    radial-gradient(circle at top left, rgba(34, 143, 157, 0.18), transparent 40%),
    linear-gradient(180deg, #ffffff 0%, #e7f5f7 100%);
  box-shadow: 0 12px 28px rgba(34, 143, 157, 0.14);
  transform: translateY(-1px);
}

.item-image-dropzone-title {
  font-family: "Futurastd", "Avenir Next", sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.01em;
  color: var(--text);
  line-height: 1.2;
}

.item-image-dropzone-copy,
.item-image-dropzone-meta {
  display: block;
  color: var(--muted);
  max-width: 20ch;
  line-height: 1.25;
  font-size: 0.64rem;
}

.item-image-dropzone-meta {
  font-size: 0.6rem;
}

.item-image-container {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.item-image-preview-card {
  display: grid;
  gap: 8px;
  align-content: start;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfcfd 100%);
  min-height: 148px;
  width: min(100%, 220px);
}

.item-image-preview-card.is-empty {
  border-style: dashed;
}

.item-image-preview {
  width: min(100%, 220px);
  max-width: 220px;
  height: auto;
  max-height: 220px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 32, 0.08);
  background: #f5f7f8;
}

.item-image-empty {
  width: min(100%, 220px);
  min-height: 148px;
  display: grid;
  place-items: center;
  gap: 4px;
  padding: 10px;
  text-align: center;
  color: var(--muted);
  border-radius: 12px;
  background: repeating-linear-gradient(135deg, #f8fbfc 0, #f8fbfc 16px, #f2f7f8 16px, #f2f7f8 32px);
}

.item-image-empty strong {
  color: var(--text);
}

.item-image-empty span {
  max-width: 21ch;
  line-height: 1.3;
  font-size: 0.82rem;
}

.item-image-caption {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.28;
}

.item-image-container .item-photo-gallery-section {
  flex: 1;
  min-width: 280px;
  margin-top: 0;
}

.item-photo-gallery-section {
  margin-top: 14px;
  display: grid;
  gap: 10px;
}

.item-photo-gallery-head {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  align-items: baseline;
}

.item-photo-gallery-head strong {
  font-family: "Futurastd", "Avenir Next", sans-serif;
  color: var(--text);
}

.item-photo-gallery-head span {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.4;
}

.item-photo-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 12px;
  justify-items: start;
}

.item-photo-gallery-grid[data-existing-photo-gallery] {
  grid-template-columns: repeat(auto-fit, minmax(66px, 1fr));
  gap: 6px;
}

.item-photo-tile {
  position: relative;
  display: grid;
  gap: 8px;
  padding: 8px;
  border: 1px solid rgba(15, 23, 32, 0.1);
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbfc 100%);
  transition: opacity 140ms ease, transform 140ms ease, border-color 140ms ease;
  width: min(100%, 33vw);
}

.item-photo-gallery-grid[data-existing-photo-gallery] .item-photo-tile {
  gap: 4px;
  padding: 4px;
  border-radius: 10px;
  width: min(100%, 16.5vw);
}

.item-photo-tile.is-removed {
  opacity: 0.5;
  border-style: dashed;
}

.item-photo-tile img {
  width: 100%;
  max-width: 33vw;
  max-height: 33vw;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 12px;
  background: #f5f7f8;
}

.item-photo-gallery-grid[data-existing-photo-gallery] .item-photo-tile img {
  max-width: 16.5vw;
  max-height: 16.5vw;
  border-radius: 8px;
}

.item-photo-tile-meta {
  display: grid;
  gap: 6px;
}

.item-photo-gallery-grid[data-existing-photo-gallery] .item-photo-tile-meta {
  gap: 3px;
}

.item-photo-remove-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 18px;
  height: 18px;
  border: 1px solid rgba(148, 35, 49, 0.35);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.95);
  color: #942331;
  font-size: 0.72rem;
  line-height: 1;
  font-weight: 700;
  padding: 0;
  cursor: pointer;
}

.item-photo-remove-btn:hover,
.item-photo-remove-btn:focus-visible {
  background: #942331;
  color: #fff;
}

.item-photo-primary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  max-width: 100%;
  border: 1px solid rgba(34, 143, 157, 0.25);
  border-radius: 999px;
  padding: 3px 6px;
  background: #fff;
  color: #176b75;
  font-size: 0.54rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
}

.item-photo-primary-btn:hover,
.item-photo-primary-btn:focus-visible,
.item-photo-primary-btn[aria-pressed="true"] {
  background: rgba(34, 143, 157, 0.14);
  border-color: rgba(34, 143, 157, 0.45);
}

.item-photo-tile.is-primary {
  border-color: rgba(34, 143, 157, 0.45);
}

.item-photo-tile.is-removed .item-photo-remove-btn {
  background: #942331;
  color: #fff;
}

.item-photo-badge,
.item-photo-count {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(34, 143, 157, 0.12);
  color: #176b75;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.item-photo-file {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
  word-break: break-word;
}

.item-photo-remove-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 0.82rem;
}

.item-photo-gallery-grid[data-existing-photo-gallery] .item-photo-badge,
.item-photo-gallery-grid[data-existing-photo-gallery] .item-photo-remove-toggle {
  font-size: 0.41rem;
}

.item-photo-gallery-grid[data-existing-photo-gallery] .item-photo-badge {
  padding: 2px 5px;
}

.item-photo-gallery-grid[data-existing-photo-gallery] .item-photo-remove-toggle input {
  width: 10px;
  height: 10px;
}

.item-photo-remove-toggle input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.item-name-cell {
  position: relative;
}

.item-name-wrap {
  position: relative;
  display: grid;
  gap: 4px;
}

.item-hover-preview,
.item-inline-preview {
  margin: 0;
}

.item-hover-preview img,
.item-inline-preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.item-hover-preview {
  position: absolute;
  top: 50%;
  left: calc(100% + 18px);
  width: min(180px, 33vw);
  height: min(180px, 33vw);
  padding: 8px;
  border-radius: 20px;
  border: 1px solid rgba(15, 23, 32, 0.08);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 42px rgba(15, 23, 32, 0.18);
  opacity: 0;
  transform: translateY(-50%) scale(0.96);
  pointer-events: none;
  transition: opacity 140ms ease, transform 140ms ease;
  transition-delay: 0ms;
  z-index: var(--z-popover);
}

.item-hover-preview img {
  border-radius: 14px;
}

.item-inline-preview {
  display: none;
  width: 92px;
  height: 92px;
  margin-top: 8px;
  padding: 4px;
  border-radius: 16px;
  border: 1px solid rgba(15, 23, 32, 0.08);
  background: #fff;
}

.item-inline-preview img {
  border-radius: 12px;
}

@media (hover: hover) {
  .table-panel tbody tr:hover .item-hover-preview,
  .table-panel tbody tr:focus-within .item-hover-preview {
    opacity: 1;
    transform: translateY(-50%) scale(1);
    transition-delay: 2000ms;
  }
}

@media (hover: none) {
  .item-hover-preview {
    display: none;
  }

  .item-inline-preview {
    display: block;
  }
}

@media (max-width: 960px) {
  .allocation-editor-head {
    flex-direction: column;
  }

  .allocation-total {
    justify-items: start;
  }

  .allocation-row {
    grid-template-columns: minmax(0, 1fr) 120px;
  }

  .allocation-remove-btn {
    grid-column: 1 / -1;
  }

  .actions {
    min-width: 0;
  }

  .item-image-layout {
    grid-template-columns: 1fr;
  }

  .item-image-dropzone {
    min-height: 120px;
    width: 100%;
  }

  .item-image-preview-card,
  .item-image-empty,
  .item-image-preview {
    min-height: 160px;
    height: auto;
  }

  .item-photo-gallery-grid {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  }
}

@media (max-width: 640px) {
  .allocation-row,
  .loan-inline-form {
    grid-template-columns: 1fr;
  }

  .qty-allocation-head,
  .location-action-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .item-image-container {
    flex-direction: column;
  }

  .item-image-container .item-photo-gallery-section {
    min-width: auto;
  }

  .item-image-dropzone {
    min-height: 110px;
    width: 100%;
    padding: 12px;
  }

  .item-image-preview,
  .item-image-empty,
  .item-image-preview-card {
    min-height: 150px;
    width: 100%;
    max-width: 100%;
  }

  .item-inline-preview {
    width: 84px;
    height: 84px;
  }

  .item-photo-gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 480px) {
  .qty-adjuster {
    width: 100%;
    justify-content: space-between;
  }

  .allocation-combined-top .qty-adjuster {
    width: auto;
    justify-content: initial;
  }

  .loan-pill-form {
    align-items: flex-start;
    flex-direction: column;
    border-radius: 16px;
  }

  .item-image-dropzone-title {
    font-size: 0.9rem;
  }

  .item-image-dropzone-copy,
  .item-image-dropzone-meta,
  .item-image-caption,
  .item-photo-gallery-head span,
  .item-photo-remove-toggle,
  .item-photo-file {
    font-size: 0.74rem;
  }

  .item-image-dropzone-copy {
    display: none;
  }

  .item-image-dropzone {
    min-height: 136px;
  }

  .item-image-preview,
  .item-image-empty,
  .item-image-preview-card {
    min-height: 136px;
  }

  .item-inline-preview {
    width: 76px;
    height: 76px;
  }
}

@media (max-width: 360px) {
  .allocation-total {
    width: 100%;
  }

  .qty-btn {
    width: 32px;
    min-width: 32px;
    height: 32px;
  }

  .item-image-dropzone {
    min-height: 124px;
    padding: 10px;
    border-radius: 12px;
  }

  .item-image-preview-card,
  .item-photo-tile {
    border-radius: 12px;
  }

  .item-image-preview,
  .item-image-empty,
  .item-image-preview-card {
    min-height: 124px;
  }
}


/* ===== Catalogue fournisseur (Promogroup) ===== */

.catalog-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.inline-form {
  display: inline;
  margin: 0;
}

.catalog-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin: 16px 0;
}

.catalog-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.catalog-stat:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.catalog-stat.is-selected {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.catalog-stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.1;
}

.catalog-stat-label {
  font-size: 0.82rem;
  color: var(--muted);
}

.catalog-stat.is-stock .catalog-stat-value { color: #0a6b34; }
.catalog-stat.is-pending .catalog-stat-value { color: var(--warning); }
.catalog-stat.is-none .catalog-stat-value { color: var(--muted); }

.catalog-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  white-space: nowrap;
  text-decoration: none;
}

.catalog-badge.is-stock {
  background: #d8f2e2;
  color: #0a6b34;
}

.catalog-badge.is-pending {
  background: #fdf0d5;
  color: #8a5a00;
}

.catalog-badge.is-none {
  background: transparent;
  color: var(--muted);
}

a.catalog-badge.is-pending:hover {
  background: #f8e2b0;
}

.catalog-number {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  white-space: nowrap;
}

.catalog-sub {
  display: block;
  font-size: 0.78rem;
}

.catalog-item-link {
  display: block;
  color: var(--accent);
  text-decoration: none;
  font-size: 0.86rem;
}

.catalog-item-link:hover {
  text-decoration: underline;
}

.catalog-import-form,
.catalog-mapping-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: flex-start;
  margin-top: 12px;
}

.catalog-mapping-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
  width: 100%;
}

.required-mark {
  color: var(--danger);
}

.catalog-preview-table {
  font-size: 0.8rem;
}

.catalog-preview-table td {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.catalog-match-group {
  margin-bottom: 14px;
}

.catalog-match-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.catalog-match-name {
  margin-left: 10px;
  font-size: 0.95rem;
}

.catalog-match-head-right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

@media (max-width: 640px) {
  .catalog-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Selection de l'onglet a importer (classeurs multi-onglets) */

.catalog-sheet-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: flex-start;
  margin-top: 12px;
  width: 100%;
}

.catalog-sheet-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 10px;
  width: 100%;
}

.catalog-sheet-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.catalog-sheet-card:hover {
  border-color: var(--accent);
}

.catalog-sheet-card:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.catalog-sheet-card.is-empty {
  opacity: 0.65;
}

.catalog-sheet-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.catalog-sheet-name {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}

.catalog-sheet-columns {
  font-size: 0.76rem;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------------------------------------------------------------------------
   Pages d'erreur (404, 500, 503, ...)
   Le meme gabarit sert tous les codes: seuls le chiffre et les textes changent.
   --------------------------------------------------------------------------- */

.error-page {
  max-width: 680px;
  margin: 48px auto;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.error-code {
  font-family: "Futurastd", "Avenir Next", sans-serif;
  font-size: clamp(72px, 18vw, 132px);
  line-height: 1;
  font-weight: 500;
  color: var(--accent);
  opacity: 0.16;
  letter-spacing: -0.04em;
  margin-bottom: -0.32em;
  user-select: none;
}

.error-head h1 {
  font-size: clamp(22px, 4vw, 30px);
  margin: 12px 0 10px;
}

.error-kicker {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 12px;
  color: var(--accent);
  font-weight: 600;
}

.error-explication {
  margin: 0 auto;
  max-width: 46ch;
  color: var(--muted);
  line-height: 1.55;
}

.error-conseils {
  margin: 26px auto 0;
  max-width: 46ch;
  text-align: left;
  background: var(--accent-soft);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 20px;
}

.error-conseils h2 {
  margin: 0 0 8px;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text);
}

.error-conseils ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.6;
  font-size: 14px;
}

.error-conseils li + li {
  margin-top: 6px;
}

.error-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 28px;
}

.btn-error-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 22px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--brand-white);
  text-decoration: none;
  font-weight: 600;
  border: 1px solid var(--accent);
  transition: filter 0.15s ease;
}

.btn-error-primary:hover {
  filter: brightness(1.08);
}

.error-actions .btn-secondary {
  padding: 11px 22px;
  border-radius: 999px;
  cursor: pointer;
}

.error-reference {
  margin: 22px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.error-reference code {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 2px 7px;
  font-size: 12px;
}

@media (max-width: 520px) {
  .error-page {
    margin: 24px auto;
  }

  .error-actions {
    flex-direction: column;
  }

  .error-actions > * {
    width: 100%;
  }
}
