/* Fields that share a row in a ModelAdmin's fieldsets - a tuple, e.g.
   ("number", "status") - sit side by side on wide screens, label above value.
   Unfold itself gives every field its own full-width line; below 1024px that
   stacked layout is kept, which is what a phone or a narrow window needs. */
@media (min-width: 1024px) {
  .form-rows .field-row:has(> .field-line + .field-line) {
    display: flex;
  }

  .form-rows .field-row:has(> .field-line + .field-line) > .field-line {
    flex: 1 1 0;
    min-width: 0;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0.25rem;
  }

  /* The label block: full width above its value, not Unfold's fixed 14rem. */
  .form-rows .field-row:has(> .field-line + .field-line) > .field-line > div:first-child {
    width: 100%;
    min-width: 0;
    height: auto;
    line-height: 1.25;
  }

  .form-rows .field-row:has(> .field-line + .field-line) > .field-line > div:first-child label {
    margin-bottom: 0.25rem;
  }

  .form-rows .field-row:has(> .field-line + .field-line) > .field-line > .grow {
    width: 100%;
  }

  .form-rows .field-row:has(> .field-line + .field-line) > .field-line + .field-line {
    border-left: 1px dashed rgba(128, 128, 128, 0.25);
  }
}

/* ---------------------------------------------------------------------------
   The work board (warehouse and delivery) and its forms: built for a phone held
   in one hand - one column, big touch targets, the essentials on each card.
   Tablet gets two columns, a desktop three.
   --------------------------------------------------------------------------- */
.hog-board { display: flex; flex-direction: column; gap: 1.75rem; }
.hog-board-bar { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: 1rem; font-size: .875rem; opacity: .85; }

.hog-section-head h2 { font-size: 1.125rem; font-weight: 700; display: flex; align-items: center; gap: .5rem; }
.hog-section-head p { font-size: .875rem; opacity: .7; margin-top: .125rem; }
.hog-count { display: inline-flex; min-width: 1.75rem; height: 1.75rem; align-items: center; justify-content: center; padding: 0 .5rem; border-radius: 999px; background: var(--color-primary-600); color: #fff; font-size: .875rem; }

.hog-cards { display: grid; grid-template-columns: 1fr; gap: .875rem; margin-top: .75rem; }
@media (min-width: 768px) { .hog-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1280px) { .hog-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.hog-card { display: flex; flex-direction: column; gap: .625rem; padding: 1rem; border: 1px solid var(--color-base-200); border-radius: .75rem; background: #fff; min-width: 0; }
.dark .hog-card { border-color: var(--color-base-700); background: var(--color-base-900); }
.hog-card-top { display: flex; align-items: center; justify-content: space-between; gap: .5rem; flex-wrap: wrap; }
.hog-number { font-weight: 700; font-size: 1rem; text-decoration: underline; text-underline-offset: 3px; }
.hog-status { font-size: .75rem; font-weight: 600; padding: .125rem .625rem; border-radius: 999px; background: var(--color-base-100); color: var(--color-base-700); }
.dark .hog-status { background: var(--color-base-800); color: var(--color-base-200); }
.hog-status-prete { background: #dcfce7; color: #166534; }
.hog-status-en_livraison { background: #dbeafe; color: #1e40af; }
.hog-status-en_preparation { background: #fef3c7; color: #92400e; }
.hog-client { font-size: 1.0625rem; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.hog-meta { font-size: .8125rem; opacity: .7; }

.hog-contact { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .5rem; }
.hog-contact li { display: flex; align-items: flex-start; gap: .5rem; font-size: .9375rem; overflow-wrap: anywhere; }
.hog-contact a { display: inline-flex; align-items: center; gap: .5rem; min-height: 2.75rem; font-weight: 600; text-decoration: none; }
.hog-contact a:not(.hog-route) { border-bottom: 2px solid var(--color-primary-600); min-height: 0; padding-bottom: .125rem; }
.hog-contact .material-symbols-outlined { font-size: 1.25rem; flex: none; }
.hog-contact .hog-route { min-height: 0; margin-left: auto; flex: none; white-space: nowrap; }
.hog-warn { color: #b45309; }

.hog-items { list-style: none; margin: 0; padding: .5rem 0; border-top: 1px dashed rgba(128,128,128,.35); border-bottom: 1px dashed rgba(128,128,128,.35); display: flex; flex-direction: column; gap: .5rem; }
.hog-items li { display: flex; gap: .75rem; align-items: baseline; }
.hog-qty { flex: none; min-width: 2.75rem; font-weight: 800; font-size: 1.125rem; text-align: right; }
.hog-item-name { display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; line-height: 1.3; }
.hog-item-name small { opacity: .55; font-size: .75rem; }
.hog-more { opacity: .7; font-size: .875rem; }
.hog-note { font-size: .875rem; padding: .5rem .75rem; border-radius: .5rem; background: #fef9c3; color: #713f12; }
.hog-empty { display: flex; align-items: center; gap: .5rem; padding: 1rem; opacity: .7; }

.hog-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: auto; padding-top: .25rem; }
.hog-btn { flex: 1 1 9rem; display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 3rem; padding: 0 1rem; border: 1px solid var(--color-base-300); border-radius: .625rem; font-weight: 600; font-size: .9375rem; text-align: center; background: transparent; cursor: pointer; text-decoration: none; }
.dark .hog-btn { border-color: var(--color-base-600); }
.hog-btn .material-symbols-outlined { font-size: 1.25rem; }
.hog-btn-primary { flex: 1 1 100%; background: var(--color-primary-600); border-color: var(--color-primary-600); color: #fff; }
.hog-btn-wide { flex: 1 1 100%; }
.hog-btn:active { transform: scale(.98); }

/* Step buttons at the top of an order page. The floor always sees them; others
   only where Unfold folds its own buttons away (below 1024px). */
.hog-steps { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
@media (min-width: 1024px) { .hog-steps-small-only { display: none; } }

/* The delivery form and the "ready" form. */
.hog-form-page { display: flex; flex-direction: column; gap: 1.25rem; max-width: 40rem; margin: 0 auto; padding: 1.25rem; border: 1px solid var(--color-base-200); border-radius: .75rem; background: #fff; }
.dark .hog-form-page { border-color: var(--color-base-700); background: var(--color-base-900); }
.hog-form { display: flex; flex-direction: column; gap: 1.25rem; }
.hog-form label { display: block; margin-bottom: .375rem; font-weight: 600; font-size: .9375rem; }
.hog-form input[type="text"], .hog-form input[type="file"] { width: 100%; min-height: 3rem; font-size: 1rem; }
.hog-help { font-size: .8125rem; opacity: .65; margin-top: .25rem; }
.hog-error { padding: .75rem; border: 1px solid #fca5a5; background: #fef2f2; color: #b91c1c; border-radius: .5rem; font-size: .9375rem; }
.hog-pad-wrap { position: relative; }
.hog-pad { display: block; width: 100%; height: 14rem; border: 2px dashed var(--color-base-400); border-radius: .75rem; background: #fff; touch-action: none; cursor: crosshair; }
.hog-pad-clear { position: absolute; top: .5rem; right: .5rem; min-height: 2.25rem; padding: 0 .75rem; background: rgba(255,255,255,.9); color: #111; }
.hog-form input[type="text"], .hog-form input[type="file"] { padding: .5rem .75rem; border: 1px solid var(--color-base-300); border-radius: .625rem; background: #fff; color: #111; }
.dark .hog-form input[type="text"], .dark .hog-form input[type="file"] { border-color: var(--color-base-600); background: var(--color-base-800); color: #fff; }
.hog-form input:focus-visible { outline: 2px solid var(--color-primary-600); outline-offset: 1px; }
.hog-form ul.errorlist { list-style: none; margin: .25rem 0 0; padding: 0; color: #b91c1c; font-size: .875rem; }
.hog-board-bar .hog-btn { flex: 0 0 auto; min-height: 2.5rem; }

/* Small screens: a <fieldset> will not shrink below its widest word unless told
   to, and a long URL or token has to wrap rather than widen the whole page. */
fieldset { min-width: 0; }
.readonly, .break-words, td, .field-line { overflow-wrap: anywhere; }

/* Tabs of a long form (order, product, client...): one line each, and the bar
   scrolls sideways on a phone instead of clipping the tabs past the edge. */
.form-rows div:has(> nav.flex-row) { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.form-rows nav.flex-row { flex-wrap: nowrap; min-width: max-content; }
.form-rows nav.flex-row > a { white-space: nowrap; }

/* What a deletion does and does not touch, above the list of what goes with it. */
.hog-delete-notes {
    margin-bottom: 1rem; padding: .75rem 1rem; border-radius: .5rem;
    border: 1px solid #f59e0b; background: #fffbeb; color: #78350f; font-size: .875rem;
}
.hog-delete-notes ul { margin: .35rem 0 0; padding-left: 1.1rem; list-style: disc; }
.dark .hog-delete-notes { background: #3b2a06; color: #fde68a; border-color: #b45309; }
.hog-delete-quickbooks {
    display: flex; gap: .6rem; align-items: flex-start; padding: .75rem 1rem; border-radius: .5rem;
    border: 1px solid #94a3b8; font-size: .875rem; cursor: pointer;
}
.hog-delete-quickbooks input { margin-top: .2rem; width: 1.1rem; height: 1.1rem; flex: none; }
.hog-delete-quickbooks-list, .hog-delete-quickbooks-help { display: block; }
.hog-delete-quickbooks-help { opacity: .75; font-size: .8rem; margin-top: .15rem; }

/* Freshness of the catalogue, above the product list. */
.hog-sync-banner {
    margin-bottom: 1rem; padding: .5rem .85rem; border-radius: .5rem; font-size: .85rem;
    border: 1px solid #94a3b8;
}
.hog-sync-banner span { opacity: .8; margin-left: .35rem; }

/* "Se déconnecter": always in reach on a phone, red so it is not pressed by mistake. */
.hog-logout { margin: 0; }
.hog-btn-logout { flex: 1 1 100%; width: 100%; color: #b91c1c; border-color: #fca5a5; }
.dark .hog-btn-logout { color: #f87171; border-color: #7f1d1d; }
.hog-board-bar .hog-logout { margin-left: auto; }
.hog-board-bar .hog-btn-logout { width: auto; flex: 0 0 auto; }
.hog-page-logout { margin-top: 1.5rem; }

.hog-qty-list li { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.hog-qty-input { width: 5rem; min-height: 2.75rem; text-align: center; font-size: 1.1rem; font-weight: 600; }

/* The floor's checklist: one round button per article (a tick per unit), the
   photos, and what is still missing. Used on the "Commande prête", pickup and
   delivery pages. */
.hog-checks { display: flex; flex-direction: column; gap: .75rem; }
.hog-checks-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .5rem; }
.hog-check { display: grid; grid-template-columns: auto 1fr auto; gap: .5rem .75rem; align-items: center; padding: .625rem .75rem; border: 1px solid var(--color-base-300); border-radius: .75rem; }
.dark .hog-check { border-color: var(--color-base-600); }
.hog-check.is-done { border-color: #16a34a; background: rgb(22 163 74 / .08); }
.hog-tick { width: 3.5rem; height: 3.5rem; border-radius: 9999px; border: 3px solid var(--color-primary-600); background: transparent; font-weight: 700; font-size: 1rem; color: var(--color-primary-600); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.hog-tick:active { transform: scale(.94); }
.hog-tick:disabled { cursor: default; opacity: .9; }
.hog-check.is-done .hog-tick { background: #16a34a; border-color: #16a34a; color: #fff; }
.hog-check.is-full:not(.is-done) .hog-tick { border-color: #d97706; color: #d97706; }
.hog-check-name { font-weight: 600; min-width: 0; }
.hog-check-name small { display: block; font-weight: 400; opacity: .75; }
.hog-check-side { display: flex; align-items: center; gap: .5rem; }
.hog-untick { border: 1px solid var(--color-base-300); border-radius: 9999px; width: 2.25rem; height: 2.25rem; background: transparent; cursor: pointer; font-size: 1.125rem; }
.hog-untick:disabled { opacity: .35; cursor: default; }
.hog-photos { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.hog-photo-add { display: inline-flex; align-items: center; gap: .375rem; min-height: 2.75rem; padding: 0 .875rem; border: 1px dashed var(--color-primary-600); border-radius: .625rem; color: var(--color-primary-600); font-weight: 600; cursor: pointer; }
.hog-photo-add input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.hog-photo-thumb { position: relative; width: 3.5rem; height: 3.5rem; }
.hog-photo-thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: .5rem; border: 1px solid var(--color-base-300); }
.hog-photo-thumb button { position: absolute; top: -.375rem; right: -.375rem; width: 1.5rem; height: 1.5rem; border-radius: 9999px; border: 0; background: #b91c1c; color: #fff; cursor: pointer; line-height: 1; }
.hog-photo-missing { color: #b45309; font-size: .875rem; }
.hog-global { padding: .75rem; border: 1px solid var(--color-base-300); border-radius: .75rem; }
.hog-global.is-done { border-color: #16a34a; background: rgb(22 163 74 / .08); }
.hog-global-title { font-weight: 700; margin-bottom: .25rem; }
.hog-gaps { margin: 0; padding: .625rem .875rem; border-radius: .625rem; background: #fef3c7; color: #92400e; font-size: .9375rem; }
.hog-gaps.is-ready { background: #dcfce7; color: #166534; }
.hog-checks-error { padding: .625rem .875rem; border-radius: .625rem; background: #fee2e2; color: #b91c1c; font-size: .9375rem; }
