/* ===== Elleshoppe — Vinted Tools — feuille de style ===== */

:root {
  --rose:        #c81d62;
  --rose-dark:   #9c1a4f;
  --rose-soft:   #fce4ee;
  --bg:          #fdf2f6;
  --card:        #ffffff;
  --ink:         #2a1622;
  --ink-soft:    #8a6b78;
  --line:        #f0d9e3;
  --crit:        #e0322e;
  --high:        #ef7a1a;
  --mod:         #e0a417;
  --ok:          #2faa5b;
  --shadow:      0 6px 22px rgba(154, 26, 79, .10);
  --radius:      18px;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html, body {
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  padding-bottom: calc(74px + env(safe-area-inset-bottom));
}

/* ---------- Topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(14px + env(safe-area-inset-top)) 18px 14px;
  background: linear-gradient(135deg, var(--rose) 0%, var(--rose-dark) 100%);
  color: #fff;
}
.brand { display: flex; align-items: center; gap: 11px; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 11px;
  background: rgba(255,255,255,.18);
  display: grid; place-items: center;
  font-weight: 800; font-size: 1.25rem;
}
.topbar h1 { font-size: 1.18rem; font-weight: 700; letter-spacing: -.2px; }
.brand-sub { font-size: .74rem; opacity: .8; }
.scan-info { font-size: .72rem; opacity: .85; text-align: right; line-height: 1.3; }

/* ---------- Vues ---------- */
.view { padding: 16px 14px 8px; animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- Cartes ---------- */
.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}
.card-title { font-size: 1rem; font-weight: 700; margin-bottom: 4px; }
.card-hint { font-size: .82rem; color: var(--ink-soft); margin-bottom: 12px; line-height: 1.45; }

/* ---------- Carte score ---------- */
.score-card { display: flex; align-items: center; gap: 16px; }
.score-ring {
  width: 92px; height: 92px; border-radius: 50%;
  display: grid; place-items: center; flex-shrink: 0;
  background: conic-gradient(var(--crit) var(--ring-deg, 0deg), var(--ok) 0deg);
  position: relative;
}
.score-ring::after {
  content: ""; position: absolute; inset: 9px;
  background: var(--card); border-radius: 50%;
}
.score-val { position: relative; font-size: 1.9rem; font-weight: 800; line-height: 1; }
.score-max { position: relative; font-size: .7rem; color: var(--ink-soft); margin-top: 2px; }
.score-text h2 { font-size: 1.05rem; }
.score-text p { font-size: .85rem; color: var(--ink-soft); margin-top: 3px; line-height: 1.4; }

/* ---------- Grille de stats ---------- */
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.stat {
  background: var(--card); border-radius: 14px; padding: 14px;
  box-shadow: var(--shadow); border-left: 4px solid var(--c, var(--rose));
}
.stat-num { font-size: 1.7rem; font-weight: 800; line-height: 1; }
.stat-lbl { font-size: .78rem; color: var(--ink-soft); margin-top: 4px; }

/* ---------- Barre neuf/occasion ---------- */
.bar-track {
  height: 26px; border-radius: 9px; overflow: hidden;
  display: flex; background: var(--rose-soft); position: relative;
}
.bar-fill { height: 100%; display: grid; place-items: center; font-size: .72rem; font-weight: 700; color: #fff; }
.bar-neuf { background: linear-gradient(var(--high), var(--crit)); }
.bar-occ  { background: var(--ok); }
.bar-target {
  position: absolute; top: -3px; bottom: -3px; width: 2px;
  background: var(--ink); left: 40%;
}
.bar-legend { display: flex; justify-content: space-between; font-size: .76rem; margin-top: 8px; color: var(--ink-soft); }
.bar-legend .target { font-weight: 600; }

/* ---------- Familles ---------- */
.fam-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 0; border-bottom: 1px solid var(--line);
}
.fam-row:last-child { border-bottom: 0; }
.fam-name { flex: 1; font-size: .9rem; font-weight: 600; }
.fam-count {
  font-size: .8rem; font-weight: 800; min-width: 30px; text-align: center;
  padding: 3px 8px; border-radius: 8px;
}
.fam-meter { width: 70px; height: 7px; border-radius: 4px; background: var(--rose-soft); overflow: hidden; }
.fam-meter > div { height: 100%; }

/* ---------- Filtres / chips ---------- */
.filters { margin-bottom: 12px; }
input[type=search], input[type=text] {
  width: 100%; padding: 12px 14px; font-size: .95rem;
  border: 1.5px solid var(--line); border-radius: 12px;
  background: var(--card); color: var(--ink); outline: none;
}
input:focus { border-color: var(--rose); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.chip {
  font-size: .78rem; font-weight: 600; padding: 7px 12px;
  border-radius: 20px; border: 1.5px solid var(--line);
  background: var(--card); color: var(--ink-soft); cursor: pointer;
}
.chip.is-active { background: var(--rose); border-color: var(--rose); color: #fff; }
.result-count { font-size: .8rem; color: var(--ink-soft); margin-bottom: 10px; }

/* ---------- Article ---------- */
.article {
  background: var(--card); border-radius: 14px; padding: 13px;
  margin-bottom: 10px; box-shadow: var(--shadow);
  display: flex; gap: 11px; align-items: flex-start;
}
.art-score {
  flex-shrink: 0; width: 42px; height: 42px; border-radius: 11px;
  display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 1.05rem;
}
.art-body { flex: 1; min-width: 0; }
.art-title { font-size: .88rem; font-weight: 600; line-height: 1.35; }
.art-meta { font-size: .74rem; color: var(--ink-soft); margin-top: 4px; }
.art-reasons { margin-top: 7px; display: flex; flex-wrap: wrap; gap: 5px; }
.tag {
  font-size: .68rem; padding: 3px 7px; border-radius: 7px;
  background: var(--rose-soft); color: var(--rose-dark);
}

/* ---------- Boutons ---------- */
.btn-primary {
  width: 100%; margin-top: 12px; padding: 13px;
  background: linear-gradient(135deg, var(--rose), var(--rose-dark));
  color: #fff; font-size: .95rem; font-weight: 700;
  border: 0; border-radius: 12px; cursor: pointer;
  box-shadow: 0 4px 14px rgba(200,29,98,.32);
}
.btn-primary:active { transform: scale(.98); }

/* ---------- Résultat doublon ---------- */
.dup-verdict {
  border-radius: var(--radius); padding: 18px; margin-bottom: 14px;
  color: #fff; box-shadow: var(--shadow);
}
.dup-verdict h3 { font-size: 1.15rem; margin-bottom: 6px; }
.dup-verdict p { font-size: .86rem; opacity: .95; line-height: 1.45; }
.dup-emoji { font-size: 2rem; }

/* ---------- Plan ---------- */
.plan-progress { height: 9px; border-radius: 5px; background: var(--rose-soft); overflow: hidden; margin-top: 4px; }
.plan-progress > div { height: 100%; background: linear-gradient(90deg, var(--rose), var(--rose-dark)); transition: width .3s; }
.plan-step {
  background: var(--card); border-radius: 14px; padding: 14px;
  margin-bottom: 11px; box-shadow: var(--shadow);
}
.plan-step-head { display: flex; align-items: baseline; gap: 8px; }
.plan-date {
  font-size: .68rem; font-weight: 800; color: var(--rose);
  background: var(--rose-soft); padding: 3px 8px; border-radius: 7px;
}
.plan-step h3 { font-size: .95rem; margin: 8px 0 6px; }
.plan-task {
  display: flex; gap: 10px; padding: 8px 0; cursor: pointer;
  font-size: .85rem; line-height: 1.4; align-items: flex-start;
}
.plan-task input { width: 19px; height: 19px; margin-top: 1px; accent-color: var(--rose); flex-shrink: 0; }
.plan-task.done span { text-decoration: line-through; color: var(--ink-soft); }

/* ---------- Alerte ---------- */
.alert {
  background: linear-gradient(135deg, #e0322e, #b51f1c);
  color: #fff; border-radius: var(--radius); padding: 14px 16px;
  margin-bottom: 14px; font-size: .85rem; line-height: 1.45;
  box-shadow: 0 6px 18px rgba(224,50,46,.3);
}
.alert strong { font-weight: 800; }

/* ---------- Tabbar ---------- */
.tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px; z-index: 30;
  display: flex; background: var(--card);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -4px 20px rgba(154,26,79,.08);
}
.tab {
  flex: 1; border: 0; background: none; cursor: pointer;
  padding: 9px 4px 8px; display: flex; flex-direction: column;
  align-items: center; gap: 3px; color: var(--ink-soft);
  font-size: .68rem; font-weight: 600;
}
.tab-ico { width: 22px; height: 22px; display: block; }
.tab.is-active { color: var(--rose); }

.empty { text-align: center; color: var(--ink-soft); font-size: .85rem; padding: 30px 10px; }

/* ---------- Hub Outils ---------- */
.hub-intro { font-size: .85rem; color: var(--ink-soft); margin: 2px 4px 14px; }
.tool-grid { display: flex; flex-direction: column; gap: 12px; }
.tool-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 3px;
  background: var(--card); border: 0; border-left: 4px solid var(--rose);
  border-radius: var(--radius); padding: 15px 16px;
  box-shadow: var(--shadow); cursor: pointer; text-align: left; width: 100%;
}
.tool-card:active { transform: scale(.99); }
.tool-card-ico { font-size: 1.45rem; }
.tool-card-t { font-size: 1rem; font-weight: 700; color: var(--ink); }
.tool-card-d { font-size: .8rem; color: var(--ink-soft); }

/* ---------- En-tête d'outil ---------- */
.tool-back {
  background: none; border: 0; color: var(--rose);
  font-size: .9rem; font-weight: 700; cursor: pointer; padding: 2px 0 8px;
}
.tool-h { font-size: 1.2rem; margin-bottom: 12px; }

/* ---------- Champs ---------- */
.field-lbl {
  display: block; font-size: .8rem; font-weight: 600;
  color: var(--ink-soft); margin: 12px 0 5px;
}
input[type=number], input[type=date] {
  width: 100%; padding: 12px 14px; font-size: .95rem;
  border: 1.5px solid var(--line); border-radius: 12px;
  background: var(--card); color: var(--ink); outline: none;
}
input[type=number]:focus, input[type=date]:focus { border-color: var(--rose); }

/* ---------- Bouton secondaire ---------- */
.btn-ghost {
  padding: 11px 16px; background: var(--rose-soft); color: var(--rose-dark);
  border: 0; border-radius: 12px; font-size: .9rem; font-weight: 700; cursor: pointer;
}
.btn-ghost:active { transform: scale(.97); }

/* ---------- Générateur de titres ---------- */
.tag-bad { background: #fde2e1; color: var(--crit); }
.prop {
  border: 1.5px solid var(--line); border-radius: 13px;
  padding: 12px; margin-top: 10px; cursor: pointer;
}
.prop:active { transform: scale(.99); }
.prop-good { border-left: 4px solid var(--ok); }
.prop-mid  { border-left: 4px solid var(--mod); }
.prop-bad  { border-left: 4px solid var(--crit); }
.prop-txt { font-size: .92rem; font-weight: 600; line-height: 1.4; }
.prop-meta {
  font-size: .73rem; color: var(--ink-soft); margin-top: 6px;
  display: flex; justify-content: space-between; gap: 8px;
}
.prop-copy { color: var(--rose); font-weight: 700; white-space: nowrap; }

/* ---------- Descriptions ---------- */
.compose-box {
  background: var(--rose-soft); border-radius: 12px; padding: 14px;
  font-size: .9rem; line-height: 1.5; color: var(--ink); margin-bottom: 12px;
}
.compose-actions { display: flex; gap: 10px; }
.compose-actions .btn-primary, .compose-actions .btn-ghost { margin-top: 0; }
.compose-copy { flex: 1; }
.chip-copy { cursor: pointer; }
.chip-copy:active { background: var(--rose); color: #fff; border-color: var(--rose); }

/* ---------- Calendrier ---------- */
.cal-day { padding-top: 12px; }
.cal-date {
  font-size: .92rem; font-weight: 700; color: var(--rose);
  margin-bottom: 6px; text-transform: capitalize;
}
.cal-slot {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0; border-top: 1px solid var(--line);
}
.cal-slot:first-of-type { border-top: 0; }
.cal-hour { font-weight: 800; font-size: .9rem; min-width: 42px; }
.cal-pill { font-size: .72rem; font-weight: 700; padding: 3px 9px; border-radius: 20px; }
.cal-neuf { background: #fdebd9; color: var(--high); }
.cal-occasion { background: #ddf3e4; color: var(--ok); }
.cal-cat { font-size: .82rem; color: var(--ink-soft); }

/* ---------- Tableau performance ---------- */
.ptable { width: 100%; border-collapse: collapse; font-size: .84rem; }
.ptable th {
  text-align: left; font-size: .74rem; color: var(--ink-soft);
  font-weight: 600; padding: 6px 4px; border-bottom: 1.5px solid var(--line);
}
.ptable td { padding: 8px 4px; border-bottom: 1px solid var(--line); }
.ptable tr:last-child td { border-bottom: 0; }
.ptable th:not(:first-child), .ptable td:not(:first-child) { text-align: center; width: 58px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(86px + env(safe-area-inset-bottom));
  transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: #fff; font-size: .85rem; font-weight: 600;
  padding: 11px 20px; border-radius: 22px; z-index: 50;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Créer une annonce ---------- */
textarea {
  width: 100%; padding: 12px 14px; font-size: .95rem; font-family: inherit;
  border: 1.5px solid var(--line); border-radius: 12px;
  background: var(--card); color: var(--ink); outline: none; resize: vertical;
}
textarea:focus { border-color: var(--rose); }
.photo-drop {
  display: block; text-align: center; padding: 16px;
  border: 2px dashed var(--line); border-radius: 12px;
  color: var(--rose-dark); font-weight: 600; font-size: .9rem; cursor: pointer;
}
.photo-drop:active { background: var(--rose-soft); }
.photo-thumbs { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.photo-thumbs:empty { margin-top: 0; }
.thumb {
  position: relative; width: 66px; height: 66px; border-radius: 10px;
  background-size: cover; background-position: center; box-shadow: var(--shadow);
}
.thumb-x {
  position: absolute; top: -7px; right: -7px; width: 22px; height: 22px;
  border-radius: 50%; border: 2px solid #fff; background: var(--crit);
  color: #fff; font-size: .7rem; cursor: pointer; line-height: 1; padding: 0;
}
.ann-out {
  background: var(--rose-soft); border-radius: 12px; padding: 13px;
  font-size: .92rem; line-height: 1.5; color: var(--ink); white-space: pre-wrap;
}
.ann-note { background: #fff6e5; }
.ann-note p { font-size: .82rem; line-height: 1.45; color: #8a6a2a; margin: 0; }
.input-clear { position: relative; }
.input-clear input { padding-right: 40px; }
.clear-x {
  position: absolute; top: 50%; right: 8px; transform: translateY(-50%);
  width: 22px; height: 22px; border-radius: 50%; border: 0; padding: 0;
  background: var(--crit); color: #fff; font-size: .7rem; line-height: 1; cursor: pointer;
}
.ann-actions { display: flex; gap: 10px; margin-top: 12px; }
.ann-actions .btn-primary { margin-top: 0; flex: 1; }
.ann-actions .btn-ghost { margin-top: 0; }

/* ---------- Prix conseillé ---------- */
.price-row { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.price-main { font-size: 1.9rem; font-weight: 800; color: var(--ok); }
.price-range { font-size: .85rem; color: var(--ink-soft); }

/* ---------- Finances ---------- */
.fin-help { margin-top: 12px; }
.fin-help summary {
  cursor: pointer; color: var(--rose); font-weight: 600; font-size: .82rem;
}
.fin-steps { margin: 10px 0 0 18px; color: var(--ink-soft); font-size: .82rem; line-height: 1.5; }
.fin-steps li { margin-bottom: 6px; }

/* ---------- Commandes ---------- */
.order {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 0; border-top: 1px solid var(--line);
}
.order:first-child { border-top: 0; }
.order-img {
  width: 46px; height: 46px; border-radius: 9px; flex-shrink: 0;
  background: var(--rose-soft); object-fit: cover; display: block;
}
.order-body { flex: 1; min-width: 0; }
.order-title { font-size: .85rem; font-weight: 600; line-height: 1.3; }
.order-meta { font-size: .73rem; color: var(--ink-soft); margin-top: 3px; }
.order-prix { font-weight: 800; font-size: .92rem; white-space: nowrap; }
.art-img {
  width: 46px; height: 46px; border-radius: 9px; flex-shrink: 0;
  background: var(--rose-soft); object-fit: cover; display: block;
}

/* ---------- Graphique en barres ---------- */
.chart { display: flex; align-items: flex-end; gap: 6px; padding-top: 4px; }
.chart-col {
  flex: 1; display: flex; flex-direction: column; align-items: center; min-width: 0;
}
.chart-val { font-size: .62rem; font-weight: 700; color: var(--ink-soft); margin-bottom: 3px; }
.chart-barwrap { height: 92px; width: 100%; display: flex; align-items: flex-end; }
.chart-bar {
  width: 100%; border-radius: 5px 5px 0 0;
  background: linear-gradient(var(--rose), var(--rose-dark));
}
.chart-lbl {
  font-size: .6rem; color: var(--ink-soft); margin-top: 4px;
  white-space: nowrap; overflow: hidden; max-width: 100%;
}

/* ---------- Version PC (écrans larges) ---------- */
@media (min-width: 820px) {
  body {
    max-width: 1100px; padding-bottom: 0; min-height: 100vh;
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    grid-template-rows: auto 1fr;
  }
  .topbar { grid-column: 1 / -1; }
  .tabbar {
    grid-column: 1; grid-row: 2; align-self: start;
    position: static; transform: none; left: auto;
    width: auto; max-width: none; flex-direction: column; gap: 4px;
    padding: 14px 10px; border-top: 0; border-right: 1px solid var(--line);
    box-shadow: none;
  }
  .tab {
    flex: none; flex-direction: row; justify-content: flex-start;
    gap: 11px; padding: 12px 14px; border-radius: 12px; font-size: .92rem;
  }
  .tab.is-active { background: var(--rose-soft); }
  .tab-ico { width: 20px; height: 20px; }
  #main { grid-column: 2; grid-row: 2; min-width: 0; }
  .view { padding: 22px 26px 40px; }
  .stat-grid { grid-template-columns: repeat(4, 1fr); }
  .tool-grid { display: grid; grid-template-columns: repeat(3, 1fr); }
  #articles-list {
    display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: start;
  }
  #articles-list .article { margin-bottom: 0; }
  .toast { bottom: 28px; }
}
