/* ============================================================================
   THE ORIGINAL FIT — admin.css
   Styles for pages/admin.html only (classes prefixed .admin-* / .prod-* /
   .oa-* stay console-scoped so the storefront CSS is untouched).
   ============================================================================ */

/* topbar: stats + toolbar ----------------------------------------------------- */
.admin-topbar {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: .8rem;
}

.admin-stats {
  display: flex;
  gap: .8rem;
  flex-wrap: wrap;
}

.stat {
  min-width: 128px;
  padding: .8rem 1rem;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-1);
  display: flex;
  flex-direction: column;
  gap: .2rem;
}

.stat-n { font-weight: 900; font-size: 1.5rem; line-height: 1; letter-spacing: -.02em; }
.stat-l {
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
}

.btn-row { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin-top: .8rem; }

.admin-who {
  color: var(--muted);
  font-size: var(--fs-sm);
  margin: .2rem 0 1.4rem;
}

/* header chip ------------------------------------------------------------------ */
.admin-chip {
  color: var(--ink);
  border: 1px solid var(--line-dark);
  border-radius: var(--radius-pill);
  padding: .34em .9em;
}

/* gate -------------------------------------------------------------------------- */
.admin-gate { max-width: 560px; }
.admin-gate .form-grid { margin-top: 1rem; }
.admin-gate .btn { justify-self: start; }

.admin-note { color: var(--muted); margin-top: .4rem; }

.admin-mini {
  color: var(--muted);
  font-size: var(--fs-sm);
  margin-top: .9rem;
}
.admin-mini code { background: var(--bg-alt); padding: .06em .4em; border-radius: 4px; }
.admin-mini .u { text-decoration: underline; text-underline-offset: 3px; }

/* tabs --------------------------------------------------------------------------- */
.admin-tabs {
  display: flex;
  gap: .45rem;
  flex-wrap: wrap;
  margin-bottom: 1.4rem;
}

.tab-btn {
  padding: .55em 1.3em;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--white);
  font-weight: 700;
  font-size: var(--fs-sm);
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--muted);
  transition: all .18s var(--ease);
}

.tab-btn:hover { color: var(--ink); border-color: var(--line-dark); }
.tab-btn.is-on { background: var(--ink); border-color: var(--ink); color: var(--white); }

/* panels + toolbars ---------------------------------------------------------------- */
.admin-toolbar {
  display: flex;
  align-items: center;
  gap: .8rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.admin-note-inline { color: var(--muted); font-size: var(--fs-sm); }

.admin-search {
  flex: 1 1 220px;
  max-width: 360px;
  padding: .55em .9em;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--white);
  outline: none;
}
.admin-search:focus { border-color: var(--ink); }

/* products table --------------------------------------------------------------------- */
.table-scroll { overflow-x: auto; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-1); }

.admin-table { width: 100%; border-collapse: collapse; min-width: 640px; }

.admin-table th {
  text-align: left;
  font-size: var(--fs-xs);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
  padding: .8em .9em;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.admin-table td {
  padding: .7em .9em;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.admin-table tr:last-child td { border-bottom: 0; }
.admin-table .th-actions, .admin-table .td-actions { text-align: right; white-space: nowrap; }

.thumb {
  width: 52px;
  height: 52px;
  object-fit: contain;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #FFFFFF;
}
.thumb-empty { display: inline-block; }

/* category badge in product table */
.cat-badge {
  display: inline-flex;
  align-items: center;
  gap: .4em;
  font-size: .64rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  padding: .28em .7em;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  color: var(--ink);
  background: var(--white);
}
.cat-badge.cat-t-shirts { border-color: var(--ink); background: var(--ink); color: var(--white); }
.cat-badge.cat-chapeaux { border-color: #4a4a4a; background: #e8e8e8; color: var(--ink); }
.cat-badge.cat-sacoches { border-color: #8a8a8a; background: #f4f4f4; color: var(--ink); }

.cell-strong { font-weight: 700; }
.cell-muted { color: var(--muted); font-size: var(--fs-sm); }

/* action buttons in tables/cards ------------------------------------------------------- */
.x-btn {
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: .4em .9em;
  border: 1px solid var(--line-dark);
  border-radius: var(--radius-pill);
  background: var(--white);
  color: var(--ink);
  transition: all .15s var(--ease);
  margin-left: .35rem;
}
.x-btn:hover { background: var(--ink); color: var(--white); }
.x-btn.is-danger { border-color: #b3261e; color: #b3261e; }
.x-btn.is-danger:hover { background: #b3261e; color: var(--white); }
.x-btn:first-child { margin-left: 0; }

/* product form --------------------------------------------------------------------------- */
.prod-form { margin-bottom: 1.2rem; }
.prod-form h3 { margin-bottom: .9rem; }
.prod-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }

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

/* per-size stock grid (0009) ------------------------------------------------------------------ */
.sz-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: .55rem;
  max-width: 620px;
}
.sz-cell { display: grid; gap: .32rem; }
.sz-cell span {
  font-size: .66rem;
  font-weight: 800;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
}
.sz-cell input { width: 100%; border-radius: var(--radius-sm); }
.sz-cell input::-webkit-outer-spin-button,
.sz-cell input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* One Size (0011): full-width row beneath the ladder. The two modes are
   mutually exclusive — whichever side carries stock locks and dims the other,
   so a save can never mix ladder rows and One Size on the same product. */
.sz-cell--one { grid-column: 1 / -1; }
.sz-cell--one span { color: var(--ink); letter-spacing: .22em; }
.sz-cell.is-off { opacity: .4; }
.sz-cell input:disabled {
  color: var(--muted);
  background: var(--bg-alt);
  border-color: var(--line);
  cursor: not-allowed;
}
.sz-hint {
  max-width: 620px;
  margin-top: .5rem;
  font-size: var(--fs-xs);
  color: var(--muted);
  letter-spacing: .02em;
}
.sz-hint b { color: var(--ink); font-weight: 800; }

@media (max-width: 560px) {
  .sz-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.img-preview {
  max-width: 120px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
}

/* multi-photo uploader ------------------------------------------------------------------------ */
.dropzone {
  border: 1.5px dashed var(--line);
  border-radius: var(--radius-md);
  background: var(--white);
  padding: 1.05rem 1.2rem;
  text-align: center;
  cursor: pointer;
  outline: none;
  transition: border-color var(--ease) .2s, background var(--ease) .2s;
}
.dropzone:hover,
.dropzone:focus-visible,
.dropzone.is-drag {
  border-color: var(--ink);
  background: var(--bg-alt);
}
.dropzone .dz-hint { color: var(--muted); font-size: var(--fs-sm); }
.dropzone .dz-hint b { color: var(--ink); }
.dropzone.is-drag .dz-hint { color: var(--ink); }
.dropzone .dz-count {
  display: block;
  margin-top: .3rem;
  font-size: .68rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted-light);
}

.gal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(86px, 1fr));
  gap: .55rem;
  margin-top: .7rem;
}

.gal-thumb {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 6px;
  background: #FFFFFF;
  border: 1.5px solid var(--line);
  transition: border-color var(--ease) .2s;
}
.gal-thumb.is-cover { border-color: var(--ink); }
.gal-thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }

.gal-cov {
  position: absolute;
  left: 0; top: 0;
  padding: .16rem .45rem;
  font-size: .54rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  background: var(--black);
  color: var(--white);
  border-radius: 0 0 var(--radius-sm) 0;
  pointer-events: none;
}
.gal-x {
  position: absolute;
  right: .25rem; top: .25rem;
  width: 1.4rem; height: 1.4rem;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: rgba(10, 10, 10, .68);
  color: var(--white);
  font-size: .85rem;
  line-height: 1;
  cursor: pointer;
  transition: background var(--ease) .2s;
}
.gal-x:hover { background: var(--black); }
.gal-foot {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  display: flex;
  background: rgba(255, 255, 255, .86);
}
.gal-foot button {
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: .7rem;
  line-height: 1;
  cursor: pointer;
  transition: background var(--ease) .15s;
}
.gal-foot button:hover { background: var(--white); }
.gal-mv { flex: 1 1 26%; padding: .3rem 0; }
.gal-mv[hidden] { display: none; }
.gal-cov-btn {
  flex: 1 1 48%;
  padding: .3rem 0;
  font-size: .55rem;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.checks-row { display: flex; gap: 1.4rem; flex-wrap: wrap; margin: .3rem 0 .4rem; }

.check {
  display: inline-flex;
  align-items: center;
  gap: .45em;
  font-size: var(--fs-sm);
  color: var(--ink);
}

textarea { border-radius: var(--radius-sm); }

/* categories ------------------------------------------------------------------------------- */
.admin-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

/* Category cards carry an image, copy and actions, so they need more room
   than a plain grid on tablet and mobile. */
@media (max-width: 1020px) {
  .admin-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .admin-grid { grid-template-columns: 1fr; }
}

.cat-card { display: flex; flex-direction: column; gap: .45rem; }
.cat-card h3 { font-size: var(--fs-md); }
.cat-img { height: 120px; width: 100%; object-fit: cover; border-radius: var(--radius-sm); }
.cat-desc { color: var(--muted); font-size: var(--fs-sm); }

/* orders -------------------------------------------------------------------------------------- */
.order-admin .oa-addr { color: var(--muted); font-size: var(--fs-sm); margin-top: .5rem; }

.oa-status {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .6rem;
  margin-top: .7rem;
}

.oa-status label {
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}

.oa-status select { min-width: 160px; }

/* messages -------------------------------------------------------------------------------------- */
.msg-card .msg-body {
  margin: .65rem 0;
  padding: .7rem .9rem;
  background: var(--bg-alt);
  border-radius: var(--radius-sm);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* hero slides preview ----------------------------------------------------------------------------- */
.hero-preview-wrap {
  margin-top: .5rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--bg-alt);
  text-align: center;
}

/* dropzone visual feedback when an image is uploaded */
#hero-drop.has-image,
#cat-drop.has-image {
  border-color: var(--ink);
  background: rgba(10, 10, 10, 0.04);
}

/* category image preview */
#cat-preview img {
  display: block;
  max-width: 100%;
  max-height: 240px;
  margin: 0 auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
}
