/* Admin Expression Events — volontairement gros, clair, sans fioritures. */
:root {
  --ink: #141414;
  --body: #3d3d3d;
  --muted: #6f6f6f;
  --line: #e7e5e0;
  --bg: #f6f5f1;
  --card: #ffffff;
  --lime: #b7c832;
  --lime-deep: #8fa31c;
  --blue: #309cd8;
  --orange: #f08430;
  --red: #c0392b;
  --stock: #2e8b40;
  --stock-bg: #e8f5ea;
  --order: #a06b00;
  --order-bg: #faf1de;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Hanken Grotesk", -apple-system, sans-serif;
  font-size: 17px;
  line-height: 1.55;
  color: var(--body);
  background: var(--bg);
}

img { display: block; }
button { font: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: var(--ink); }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 20px;
  background: var(--ink);
  color: #fff;
  flex-wrap: wrap;
}

.topbar .brand { font-weight: 800; letter-spacing: 0.06em; }
.topbar .brand small { display: block; font-weight: 400; color: #bbb; letter-spacing: 0.02em; }
.topbar .spacer { flex: 1; }
.topbar .status { font-size: 14px; color: #cfcfcf; text-align: right; }

.btn {
  border: 0;
  border-radius: 8px;
  padding: 12px 20px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.btn-publish { background: var(--lime); color: var(--ink); font-size: 17px; }
.btn-publish:hover { background: var(--lime-deep); color: #fff; }
.btn-publish[disabled] { opacity: 0.6; cursor: wait; }
.btn-ghost { background: transparent; color: #cfcfcf; border: 1px solid #555; }
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: #000; }
.btn-danger { background: #fff; color: var(--red); border: 2px solid var(--red); }
.btn-danger:hover { background: var(--red); color: #fff; }
.btn-back { background: transparent; border: 0; color: var(--muted); padding: 8px 0; font-weight: 600; }
.btn-back:hover { color: var(--ink); }

.shell { max-width: 1080px; margin: 0 auto; padding: 24px 20px 80px; }

/* ---- Login ---- */
.login {
  max-width: 430px;
  margin: 10vh auto;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 32px;
  text-align: center;
}
.login h1 { font-size: 22px; color: var(--ink); margin: 0 0 6px; }
.login p { color: var(--muted); font-size: 15px; }
.login input {
  width: 100%;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 14px 0;
  font-size: 17px;
}
.login .btn { width: 100%; }
.login .msg { margin-top: 14px; font-weight: 600; color: var(--stock); }

/* ---- Toolbar liste ---- */
.tools {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.tools input[type="search"] {
  flex: 1;
  min-width: 220px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.tools select {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  max-width: 260px;
}

.count { color: var(--muted); font-size: 14px; margin: 0 0 10px; }

/* ---- Liste produits ---- */
.plist { display: grid; gap: 10px; }
.prow {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 14px;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
  text-align: left;
  width: 100%;
}
.prow:hover { border-color: var(--ink); }
.prow img, .prow .noimg {
  width: 64px;
  height: 48px;
  object-fit: cover;
  border-radius: 6px;
  background: var(--bg);
}
.prow .noimg { display: grid; place-items: center; color: #bbb; font-weight: 800; }
.prow .pname { font-weight: 700; color: var(--ink); }
.prow .pmeta { font-size: 13px; color: var(--muted); }
.prow .badges { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }

.badge {
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 99px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}
.b-stock { background: var(--stock-bg); color: var(--stock); }
.b-order { background: var(--order-bg); color: var(--order); }
.b-off { background: #eee; color: #888; }
.b-star { background: #fff6d9; color: #a07800; }
.b-new { background: #e3f1fa; color: var(--blue); }

/* ---- Éditeur ---- */
.editor {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 26px;
  margin-top: 10px;
}
.editor h1 { font-size: 22px; color: var(--ink); margin: 0 0 20px; }
.frow { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
@media (max-width: 700px) { .frow { grid-template-columns: 1fr; } }

.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 700; color: var(--ink); font-size: 14px; margin-bottom: 5px; }
.field input, .field select, .field textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.field textarea { min-height: 120px; resize: vertical; }
.hint { font-size: 13px; color: var(--muted); margin-top: 4px; }

.seg { display: flex; gap: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; width: fit-content; }
.seg label {
  padding: 11px 18px;
  margin: 0;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  background: #fff;
}
.seg input { display: none; }
.seg label:has(input:checked) { background: var(--ink); color: #fff; }

.check { display: flex; align-items: center; gap: 10px; font-weight: 600; color: var(--ink); }
.check input { width: 22px; height: 22px; accent-color: var(--lime-deep); }

/* Specs répétables */
.spec-row { display: grid; grid-template-columns: 2fr 3fr 44px; gap: 8px; margin-bottom: 8px; }
.spec-row input { padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; }
.spec-row button, .ph-actions button {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 700;
}
.spec-row button:hover, .ph-actions button:hover { color: var(--red); border-color: var(--red); }
.addline { background: none; border: 1px dashed var(--line); border-radius: 8px; width: 100%; padding: 10px; color: var(--muted); font-weight: 600; }
.addline:hover { border-color: var(--ink); color: var(--ink); }

/* Photos */
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; margin-bottom: 10px; }
.ph {
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}
.ph img { width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.ph-actions { display: flex; }
.ph-actions button { flex: 1; border: 0; border-top: 1px solid var(--line); border-radius: 0; padding: 8px 0; }
.ph-actions button + button { border-left: 1px solid var(--line); }
.ph:first-child { outline: 3px solid var(--lime); outline-offset: -3px; }
.ph-main-tag { font-size: 11px; font-weight: 800; text-align: center; color: var(--lime-deep); padding: 2px 0; text-transform: uppercase; }

.editor-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.editor-actions .spacer { flex: 1; }

/* ---- Modal ---- */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 10, 0.55);
  display: grid;
  place-items: center;
  z-index: 50;
  padding: 20px;
}
.modal {
  background: #fff;
  border-radius: 12px;
  padding: 26px;
  max-width: 480px;
  width: 100%;
  max-height: 80vh;
  overflow: auto;
}
.modal h2 { margin: 0 0 10px; font-size: 20px; color: var(--ink); }
.modal ul { padding-left: 20px; color: var(--body); }
.modal .actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }

/* ---- Toast ---- */
#toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  font-weight: 600;
  padding: 13px 22px;
  border-radius: 10px;
  z-index: 60;
  max-width: 90vw;
  text-align: center;
}
#toast.ok { background: var(--stock); }
#toast.ko { background: var(--red); }

.uploading { opacity: 0.55; pointer-events: none; }
