/* Vinted Manager — "denim de nuit". One memorable element: pending actions as hang tags. */
:root {
  --denim-night: #1F2F4A;
  --denim-washed: #2B4166;
  --denim-seam: #3A5482;
  --thread: #EEF1F5;
  --cotton: #A9B6CA;
  --mustard: #E3B23C;
  --profit: #5FB98C;
  --loss: #E06B5F;
  --tag-paper: #F3EBD8;
  --tag-ink: #2A2418;

  --font: "Archivo", "Segoe UI", system-ui, sans-serif;
  --s-1: 0.8125rem;  /* 13 */
  --s0: 0.9375rem;   /* 15 */
  --s1: 1.125rem;    /* 18 */
  --s2: 1.5rem;      /* 24 */
  --s3: 2.25rem;     /* 36 */
  --s4: 3.5rem;      /* 56 */
  --gap: 1.25rem;
  --radius-panel: 6px;
}

* { box-sizing: border-box; }
html { color-scheme: dark; }
body {
  margin: 0; font-family: var(--font); font-size: var(--s0); line-height: 1.5;
  background: var(--denim-night); color: var(--thread);
  font-variant-numeric: tabular-nums;
}
a { color: var(--thread); text-underline-offset: 3px; }
a:hover { color: var(--mustard); }
:focus-visible { outline: 2px solid var(--mustard); outline-offset: 2px; }
h1, h2, h3 { font-weight: 650; line-height: 1.2; margin: 0 0 0.6em; }
h1 { font-size: var(--s3); font-stretch: 75%; letter-spacing: -0.01em; }
h2 { font-size: var(--s2); font-stretch: 85%; }
h3 { font-size: var(--s1); }
p { max-width: 70ch; }
.muted { color: var(--cotton); }
.profit { color: var(--profit); }
.loss { color: var(--loss); }

/* ── Shell ─────────────────────────────────────────── */
.shell { display: grid; grid-template-columns: 13rem 1fr; min-height: 100vh; }
.shell > *, .split-view > *, .figures > * { min-width: 0; }   /* grid items must not grow to their content */
.nav {
  background: var(--denim-washed); padding: 1.5rem 1rem; display: flex; flex-direction: column; gap: 0.25rem;
  border-right: 2px dashed var(--denim-seam);
}
.brand { font-size: var(--s1); font-weight: 700; font-stretch: 75%; margin: 0 0.5rem 1.25rem; }
.nav a {
  text-decoration: none; padding: 0.45rem 0.6rem; border-radius: 4px; color: var(--cotton);
  display: flex; justify-content: space-between; align-items: center;
}
.nav a[aria-current="page"] { background: var(--denim-night); color: var(--thread); }
.nav .count {
  background: var(--mustard); color: var(--tag-ink); border-radius: 999px; padding: 0 0.5rem;
  font-size: var(--s-1); font-weight: 700;
}
main { padding: 2rem clamp(1rem, 3vw, 2.5rem) 4rem; max-width: 1280px; min-width: 0; }
.topline { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; }
.sim-banner {
  background: repeating-linear-gradient(-45deg, #4a3b14, #4a3b14 10px, #3d3110 10px, #3d3110 20px);
  color: var(--tag-paper); padding: 0.5rem 1rem; border-radius: var(--radius-panel); margin-bottom: 1.25rem;
}
section { margin-top: 2.25rem; }

/* ── Hang tags (pending actions) ───────────────────── */
.tags { display: flex; gap: 1rem; overflow-x: auto; padding: 0.5rem 0.25rem 1rem; scroll-snap-type: x mandatory; }
.tags.wrap { flex-wrap: wrap; overflow: visible; }
.tag {
  position: relative; flex: 0 0 18.5rem; scroll-snap-align: start;
  background: var(--tag-paper); color: var(--tag-ink);
  padding: 1.6rem 1.1rem 1rem 1.1rem; border-radius: 4px 14px 14px 4px;
  clip-path: polygon(0 0, calc(100% - 22px) 0, 100% 22px, 100% 100%, 0 100%);
}
.tag::before { /* eyelet */
  content: ""; position: absolute; top: 0.65rem; right: 0.75rem; width: 0.7rem; height: 0.7rem;
  border-radius: 50%; background: var(--denim-night); box-shadow: 0 0 0 3px #d8cdb2;
}
.tag::after { /* stitched seam */
  content: ""; position: absolute; inset: 0.4rem; border: 1.5px dashed #b9ab8a; border-radius: 3px 10px 10px 3px;
  pointer-events: none;
}
.tag .kind { font-size: var(--s-1); font-weight: 650; color: #7a5b0d; }
.tag h3 { margin: 0.15rem 0 0.2rem; font-size: var(--s1); overflow-wrap: anywhere; }
.tag .sub { font-size: var(--s-1); color: #5c5240; }
.tag .body { white-space: pre-line; font-size: var(--s-1); margin: 0.6rem 0; max-height: 9.5rem; overflow: auto; }
.tag .link { font-size: var(--s-1); overflow-wrap: anywhere; }
.tag a { color: var(--tag-ink); font-weight: 600; }
.tag a:hover { color: #7a5b0d; }
.tag .row { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.75rem; position: relative; z-index: 1; }
.tag textarea, .tag input { width: 100%; font: inherit; font-size: var(--s-1); padding: 0.35rem;
  border: 1px solid #b9ab8a; border-radius: 3px; background: #fffdf6; color: var(--tag-ink); position: relative; z-index: 1; }
.tag label { font-size: var(--s-1); display: block; margin-top: 0.4rem; position: relative; z-index: 1; }
.tag .error { color: #a3271b; font-size: var(--s-1); margin-top: 0.4rem; }
.tag.done { opacity: 0.55; }

/* ── Buttons & forms ───────────────────────────────── */
button, .btn {
  font: inherit; font-size: var(--s-1); font-weight: 650; cursor: pointer; border-radius: 4px;
  padding: 0.45rem 0.8rem; border: 1px solid var(--denim-seam); background: var(--denim-washed); color: var(--thread);
}
button:hover { border-color: var(--cotton); }
button[disabled] { opacity: 0.5; cursor: wait; }
.tag button { background: var(--tag-ink); color: var(--tag-paper); border-color: var(--tag-ink); }
.tag button.secondary { background: transparent; color: var(--tag-ink); }
.seg { display: inline-flex; border: 1px solid var(--denim-seam); border-radius: 4px; overflow: hidden; }
.seg button { border: 0; border-radius: 0; background: transparent; color: var(--cotton); }
.seg button[aria-pressed="true"] { background: var(--denim-seam); color: var(--thread); }
input, select, textarea {
  font: inherit; color: var(--thread); background: var(--denim-night); border: 1px solid var(--denim-seam);
  border-radius: 4px; padding: 0.4rem 0.5rem;
}
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); gap: 0.75rem 1rem; }
.form-grid label, form > label { display: flex; flex-direction: column; gap: 0.2rem; font-size: var(--s-1); color: var(--cotton); }
form > label { margin-top: 0.75rem; }
.form-grid input, .form-grid select, form > label textarea, form > label input { width: 100%; min-width: 0; }
textarea { resize: vertical; line-height: 1.45; }
input:disabled { opacity: 0.5; }
.form-grid label.check, label.check { flex-direction: row; align-items: center; gap: 0.5rem; color: var(--thread); align-self: end; padding-bottom: 0.45rem; }
label.check input { width: auto; accent-color: var(--mustard); }
.hint { font-size: 0.75rem; color: var(--cotton); opacity: 0.85; }
.form-error { color: var(--loss); font-size: var(--s-1); font-weight: 600; margin-top: 0.5rem; }
.form-error:empty { display: none; }
.actions { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; margin-top: 0.85rem; }
td .actions, .topline .actions { margin-top: 0; }
.inline { display: inline-flex; align-items: center; gap: 0.35rem; color: var(--cotton); font-size: var(--s-1); }
a.btn { display: inline-block; text-decoration: none; color: var(--thread); line-height: 1.5; }
a.btn:hover { color: var(--thread); border-color: var(--cotton); }
button.primary, a.btn.primary { background: var(--mustard); border-color: var(--mustard); color: var(--tag-ink); }
button.primary:hover, a.btn.primary:hover { background: #ecc35e; color: var(--tag-ink); }
.danger-btn { background: transparent; border-color: var(--loss); color: var(--loss); }
.danger-btn:hover { border-color: var(--loss); background: rgba(224, 107, 95, 0.12); }
.confirm p { margin: 0 0 0.25rem; font-weight: 600; }
.confirm .actions { margin-top: 0.25rem; }
details > summary { cursor: pointer; font-weight: 650; padding: 0.4rem 0; color: var(--thread); }
details > summary:hover { color: var(--mustard); }
details[open] > summary { margin-bottom: 0.5rem; }
.panel details { margin-top: 0.75rem; }
.sub-panel { border-left: 2px dashed var(--denim-seam); padding: 0.25rem 0 0.75rem 0.85rem; margin-bottom: 0.75rem; }
.sub-panel form .form-grid { margin-top: 0.5rem; }
table.kv th { width: 45%; font-weight: 500; border-bottom: 1px solid rgba(169, 182, 202, 0.15); }
table.kv td { overflow-wrap: anywhere; }
.account-detail > .split-view { margin-top: 0.5rem; }
.session p { margin: 0 0 0.5rem; }
.notice.start { margin-bottom: 1.5rem; }
.notice a { color: var(--mustard); }
.import-result { margin-top: 1rem; }
#account-new, #product-new, #product-import, #listing-new, #message-new { margin-bottom: 1.75rem; }

/* ── Figures ───────────────────────────────────────── */
.figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 0 2rem;
  border-top: 1px solid var(--denim-seam); }
.figure { padding: 1rem 0; border-bottom: 1px solid var(--denim-seam); }
.figure .when { color: var(--cotton); font-size: var(--s-1); }
.figure .big { font-size: var(--s4); font-stretch: 62%; font-weight: 600; line-height: 1; }
.figure .split { font-size: var(--s-1); color: var(--cotton); margin-top: 0.35rem; }

/* ── Tables & panels ───────────────────────────────── */
.panel { background: var(--denim-washed); border-radius: var(--radius-panel); padding: 1.25rem; }
.panel h3 { margin-top: 1.5rem; }
.panel > :first-child { margin-top: 0; }
table { width: 100%; border-collapse: collapse; font-size: var(--s-1); }
th { text-align: left; font-weight: 600; color: var(--cotton); padding: 0.5rem 0.6rem; border-bottom: 1px solid var(--denim-seam); }
td { padding: 0.55rem 0.6rem; border-bottom: 1px solid rgba(169, 182, 202, 0.15); vertical-align: top; }
td.num, th.num { text-align: right; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td, tr[aria-selected="true"] td { background: rgba(58, 84, 130, 0.45); }
.pill { display: inline-block; white-space: nowrap; padding: 0 0.5rem; border-radius: 999px; font-size: var(--s-1);
  border: 1px solid var(--denim-seam); color: var(--cotton); }
.pill.warn { border-color: var(--mustard); color: var(--mustard); }
.pill.bad { border-color: var(--loss); color: var(--loss); }
.pill.good { border-color: var(--profit); color: var(--profit); }
.split-view { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: var(--gap); align-items: start; }
.thread { display: flex; flex-direction: column; gap: 0.5rem; }
.bubble { max-width: 80%; padding: 0.5rem 0.75rem; border-radius: 10px; white-space: pre-line; }
.bubble.buyer { background: var(--denim-night); align-self: flex-start; }
.bubble.seller { background: var(--denim-seam); align-self: flex-end; }
.bubble .meta { display: block; font-size: 0.75rem; color: var(--cotton); margin-top: 0.2rem; }
.timeline { list-style: none; padding: 0; margin: 0; font-size: var(--s-1); }
.timeline li { padding: 0.35rem 0 0.35rem 0.9rem; border-left: 2px dashed var(--denim-seam); }
.notice { padding: 0.75rem 1rem; border-left: 3px solid var(--mustard); background: rgba(227, 178, 60, 0.08); }
.empty { color: var(--cotton); padding: 1.5rem 0; }
.toast { position: fixed; bottom: 1.25rem; right: 1.25rem; background: var(--tag-paper); color: var(--tag-ink);
  padding: 0.7rem 1rem; border-radius: 4px; max-width: 26rem; z-index: 10; }
.toast.error { background: #f6d5d0; }

/* ── Chart ─────────────────────────────────────────── */
.chart svg { width: 100%; height: auto; display: block; }
.chart .bar { fill: var(--denim-seam); }
.chart .bar.cost { fill: rgba(224, 107, 95, 0.55); }
.chart .line { fill: none; stroke: var(--profit); stroke-width: 2.5; }
.chart .dot { fill: var(--profit); }
.chart text { fill: var(--cotton); font-size: 11px; font-family: var(--font); }
.chart .axis { stroke: var(--denim-seam); }
.legend { display: flex; gap: 1.25rem; font-size: var(--s-1); color: var(--cotton); margin-top: 0.5rem; }
.legend i { display: inline-block; width: 0.8rem; height: 0.8rem; margin-right: 0.35rem; vertical-align: -1px; }

/* ── Login ─────────────────────────────────────────── */
.login { max-width: 26rem; margin: 18vh auto; }
.login .tag { flex: none; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .nav { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 2px dashed var(--denim-seam); padding: 0.75rem; }
  .brand { display: none; }
  .nav a { white-space: nowrap; }
  .split-view { grid-template-columns: 1fr; }
  table { display: block; overflow-x: auto; }
  .figure .big { font-size: var(--s3); }
}
@media (prefers-reduced-motion: no-preference) {
  .tag.arrive { animation: swing 520ms ease-out; transform-origin: calc(100% - 1.1rem) 1rem; }
  @keyframes swing { 0% { transform: rotate(-4deg); } 60% { transform: rotate(1.5deg); } 100% { transform: rotate(0); } }
}

/* ── Workflow additions ────────────────────────────── */
fieldset { border: 1px dashed var(--denim-seam); border-radius: var(--radius-panel); padding: 0.6rem 1rem 0.9rem; margin: 1rem 0 0; }
legend { padding: 0 0.4rem; font-size: var(--s-1); color: var(--cotton); font-weight: 600; }
fieldset label.check { display: inline-flex; margin-right: 1.1rem; padding-bottom: 0; }
.days { display: flex; flex-wrap: wrap; gap: 0.25rem 0; margin-bottom: 0.5rem; }
.inline-form { display: flex; gap: 0.75rem; align-items: flex-end; flex-wrap: wrap; margin-bottom: 1rem; }
.inline-form > label { margin: 0; flex: 1 1 16rem; display: flex; flex-direction: column; gap: 0.2rem; font-size: var(--s-1); color: var(--cotton); }
.inline-form .form-error { flex-basis: 100%; }
.bulk-bar { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; padding: 0.6rem 0.8rem; margin-bottom: 0.75rem;
  border: 1px dashed var(--denim-seam); border-radius: var(--radius-panel); font-size: var(--s-1); color: var(--cotton); }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: 1rem; margin-top: 1rem; }
.photo { margin: 0; background: var(--denim-night); border-radius: var(--radius-panel); overflow: hidden; }
.photo img, .photo-empty { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; background: #18253b; }
.photo-empty { display: grid; place-items: center; color: var(--cotton); }
.photo figcaption { padding: 0.6rem 0.7rem 0.75rem; font-size: var(--s-1); }
.photo .actions { margin-top: 0.5rem; }
.journey { background: var(--denim-washed); border-radius: var(--radius-panel); padding: 0.75rem 1.25rem; margin-bottom: 1.75rem; }
.journey > summary { font-size: var(--s1); }
.journey ol { margin: 0.5rem 0 0.25rem; padding-left: 1.5rem; columns: 2 22rem; column-gap: 2.5rem; }
.journey li { padding: 0.2rem 0; break-inside: avoid; color: var(--cotton); }
.journey li a { color: var(--cotton); }
.journey li.ok a { color: var(--thread); }
.journey li.next a { color: var(--mustard); font-weight: 650; }
ol.progress { padding-left: 1.25rem; font-size: var(--s-1); }
ol.progress li { padding: 0.3rem 0; overflow-wrap: anywhere; }

/* ── Agent ─────────────────────────────────────────────── */
.agent-head { border-left: 3px dashed var(--thread); padding-left: var(--gap); }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: var(--gap); }
.checklist { list-style: none; padding: 0; margin: .5rem 0; }
.checklist li { padding: .25rem 0; }
.link-btn { background: none; border: 0; padding: 0; color: inherit; font: inherit; text-decoration: underline dotted; cursor: pointer; }
.link-btn:focus-visible { outline: 2px solid var(--mustard); outline-offset: 2px; }
table.compact td, table.compact th { padding: .25rem .5rem; font-size: .9em; }
.job-events td { background: color-mix(in srgb, var(--denim-washed) 25%, transparent); }
.timeline li.error { color: var(--loss); }
.timeline li.warn { color: var(--mustard); }
.candidates { display: grid; gap: var(--gap); }
.candidate { display: grid; grid-template-columns: 96px 1fr; gap: var(--gap); padding: var(--gap);
  border: 1px dashed var(--thread); border-radius: var(--radius-panel); }
.candidate img, .candidate .noimg { width: 96px; height: 120px; object-fit: cover; border-radius: 4px; background: var(--denim-washed); }
.candidate h3 { margin: 0 0 .25rem; font-size: 1rem; }
.candidate p { margin: .25rem 0; }
@media (max-width: 560px) { .candidate { grid-template-columns: 1fr; } }

/* ── Fournisseurs ──────────────────────────────────────── */
.bookmarklet { display: inline-block; padding: .35rem .8rem; border: 2px dashed var(--mustard); border-radius: 999px;
  color: var(--cotton); text-decoration: none; font-weight: 600; cursor: grab; }
.bookmarklet:focus-visible { outline: 2px solid var(--mustard); outline-offset: 2px; }
ol.steps li { margin: .35rem 0; }
fieldset { border: 1px dashed var(--thread); border-radius: var(--radius-panel); padding: var(--gap); margin: 0 0 var(--gap); }
tr.best td { background: color-mix(in srgb, var(--profit) 14%, transparent); }
