:root {
  --canvas: #f3f6f6;
  --paper: #ffffff;
  --surface-alt: #f8fbfb;
  --ink: #0a0a0a;
  --ink-soft: #171717;
  --mid: #737373;
  --mid-light: #a3a3a3;
  --hairline: #e3e9ea;
  --ember: #e7000b;

  /* Couleurs Vinted */
  --brand: #007782;
  --brand-hover: #00656f;
  --brand-ink: #004a51;
  --brand-soft: #e5f3f4;
  --brand-softer: #f2f9f9;
  --brand-light: #8fd0d5;
  --brand-bright: #09b1ba;

  /* Couleurs de statut */
  --ok: #2f7d55;
  --ok-soft: #dcf6e7;
  --ok-line: #8fdcb2;
  --sold: #6d28d9;
  --sold-soft: #ede7fd;
  --info: #2563eb;
  --warn: #b45309;
  --warn-soft: #fdf1cc;
  --bad: #d62f2f;
  --bad-soft: #fde9e8;
  --bad-line: #f2a7a2;
  --draft: #475569;
  --draft-soft: #eef1f5;
  --amber: #b26b00;
  --amber-soft: #fff3df;

  --font: 'Geist', Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --r-card: 24px;
  --r-pill: 18px;
  --r-nested: 10px;
  --r-small: 6px;

  --shadow-card: 0 0 0 1px rgba(23,23,23,0.05), 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px -1px rgba(0,0,0,0.1);
  --shadow-pop: 0 0 0 1px rgba(23,23,23,0.05), 0 10px 30px -6px rgba(0,0,0,0.18), 0 4px 10px -4px rgba(0,0,0,0.1);
  --sidebar-w: 248px;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.43;
  font-feature-settings: "ss01" on, "cv11" on;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }

.i { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--mid); }
.danger-text { color: var(--ember); }

/* ---------- Layout ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w);
  flex: none;
  background: var(--surface-alt);
  border-right: 1px solid var(--hairline);
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 8px; }
.brand-mark {
  width: 32px; height: 32px; border-radius: var(--r-nested);
  background: var(--ink); color: #fafafa;
  display: grid; place-items: center;
  font-weight: 600; letter-spacing: -0.03em;
}
.brand-name { font-weight: 600; font-size: 14px; line-height: 1.2; }
.brand-sub { font-size: 12px; color: var(--mid); }

.search-trigger {
  display: flex; align-items: center; gap: 8px;
  background: var(--canvas); border: 0; border-radius: var(--r-pill);
  padding: 8px 10px; color: var(--mid); cursor: pointer; text-align: left;
}
.search-trigger span { flex: 1; }
kbd {
  font-family: var(--mono); font-size: 11px; color: var(--mid);
  background: var(--paper); border: 1px solid var(--hairline);
  border-radius: var(--r-small); padding: 1px 5px;
}

.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.nav-label {
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--mid); padding: 14px 10px 6px;
}
.nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px; border-radius: var(--r-pill);
  color: var(--ink-soft); font-weight: 500;
}
.nav a .i { color: var(--mid); }
.nav a:hover { background: var(--canvas); }
.nav a.active { background: var(--paper); box-shadow: var(--shadow-card); }
.nav a.active .i { color: var(--ink); }
.nav-count { margin-left: auto; font-size: 12px; color: var(--mid); font-weight: 500; }
.nav-count.hot { background: var(--ink); color: #fafafa; border-radius: var(--r-pill); padding: 0 7px; }


.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 12px;
  height: 60px; padding: 0 32px;
  border-bottom: 1px solid var(--hairline);
  background: rgba(245,245,245,0.85);
  backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 10;
}
.breadcrumb { display: flex; align-items: center; gap: 6px; color: var(--mid); flex: 1; min-width: 0; }
.breadcrumb .cur { color: var(--ink); font-weight: 500; }
.menu-btn { display: none; }

.view { padding: 32px; max-width: 1280px; width: 100%; margin: 0 auto; display: flex; flex-direction: column; gap: 24px; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head h1 { font-size: 30px; line-height: 1.2; letter-spacing: -0.025em; font-weight: 600; margin: 0; }
.page-head p { margin: 4px 0 0; color: var(--mid); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 14px; border-radius: var(--r-pill);
  border: 0; font-weight: 500; font-size: 14px; cursor: pointer; white-space: nowrap;
  transition: background .15s, opacity .15s;
}
.btn-primary { background: var(--ink); color: #fafafa; }
.btn-primary:hover { background: #262626; }
.btn-secondary { background: var(--canvas); color: var(--ink); }
.btn-secondary:hover { background: #ebebeb; }
.btn-outline { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--hairline); }
.btn-outline:hover { background: var(--surface-alt); }
.btn-danger { background: transparent; color: var(--ember); box-shadow: inset 0 0 0 1px var(--hairline); }
.btn-danger:hover { background: #fef2f2; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn-block { width: 100%; }
.icon-btn {
  width: 32px; height: 32px; border-radius: var(--r-pill); border: 0;
  background: transparent; display: inline-grid; place-items: center; cursor: pointer; color: var(--mid);
}
.icon-btn:hover { background: var(--canvas); color: var(--ink); }
.icon-btn.danger:hover { color: var(--ember); background: #fef2f2; }

/* ---------- Cards ---------- */
.card {
  background: var(--paper);
  border: 1px solid var(--hairline);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
  min-width: 0;
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 20px 0; }
.card-head h3 { margin: 0; font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.card-head p { margin: 2px 0 0; color: var(--mid); font-size: 13px; }
.card-body { padding: 20px; }
.card-foot { padding: 14px 20px; border-top: 1px solid var(--hairline); background: var(--surface-alt); border-radius: 0 0 var(--r-card) var(--r-card); color: var(--mid); font-size: 13px; }

.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }

/* ---------- Stats ---------- */
.stat { padding: 20px; display: flex; flex-direction: column; gap: 6px; }
.stat-label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--mid); display: flex; align-items: center; gap: 6px; }
.stat-value { font-size: 30px; line-height: 1.2; font-weight: 600; letter-spacing: -0.025em; font-variant-numeric: tabular-nums; }
.stat-meta { font-size: 13px; color: var(--mid); display: flex; align-items: center; gap: 6px; }
.delta { display: inline-flex; align-items: center; gap: 2px; font-weight: 500; color: var(--ink); }
.delta.down { color: var(--mid); }

.progress { height: 8px; background: var(--canvas); border-radius: 99px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--ink); border-radius: 99px; transition: width .4s; }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 500; line-height: 1.5;
  padding: 1px 8px; border-radius: var(--r-pill); white-space: nowrap;
}
.badge-solid { background: var(--ink-soft); color: #fafafa; }
.badge-soft { background: var(--canvas); color: var(--ink-soft); }
.badge-outline { box-shadow: inset 0 0 0 1px var(--hairline); color: var(--ink); }
.badge-dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-muted { background: var(--canvas); color: var(--mid); }

/* ---------- Toolbar & inputs ---------- */
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 16px 20px; border-bottom: 1px solid var(--hairline); }
.toolbar .spacer { flex: 1; }
.input, .select, textarea.input {
  background: var(--canvas); border: 0; border-radius: var(--r-pill);
  padding: 8px 12px; height: 36px; outline: none; font-size: 14px;
  box-shadow: inset 0 0 0 1px transparent; transition: box-shadow .15s, background .15s;
  min-width: 0;
}
textarea.input { height: auto; min-height: 72px; border-radius: 14px; resize: vertical; }
.input:focus, .select:focus { background: var(--paper); box-shadow: inset 0 0 0 1px var(--hairline), 0 0 0 3px rgba(10,10,10,0.06); }
.input::placeholder { color: var(--mid); }
.select { appearance: none; padding-right: 30px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23737373' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; }
.search-input { position: relative; display: flex; align-items: center; }
.search-input .i { position: absolute; left: 12px; color: var(--mid); pointer-events: none; }
.search-input .input { padding-left: 34px; width: 260px; }

.tabs { display: inline-flex; background: var(--canvas); border-radius: var(--r-pill); padding: 3px; gap: 2px; flex-wrap: wrap; }
.tab { border: 0; background: transparent; border-radius: 15px; height: 30px; padding: 0 12px; font-weight: 500; font-size: 13px; color: var(--mid); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.tab:hover { color: var(--ink); }
.tab.active { background: var(--paper); color: var(--ink); box-shadow: var(--shadow-card); }
.tab .c { font-size: 12px; color: var(--mid); }

/* ---------- Table ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th {
  text-align: left; font-weight: 500; font-size: 12px; color: var(--mid);
  padding: 10px 16px; border-bottom: 1px solid var(--hairline); white-space: nowrap;
  background: var(--surface-alt);
}
th.r, td.r { text-align: right; }
td { padding: 12px 16px; border-bottom: 1px solid var(--hairline); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--surface-alt); }
.cell-main { font-weight: 500; }
.cell-sub { font-size: 12px; color: var(--mid); }
.thumb {
  width: 36px; height: 36px; border-radius: var(--r-nested); background: var(--canvas);
  display: grid; place-items: center; font-weight: 600; font-size: 13px; color: var(--mid); flex: none;
  background-size: cover; background-position: center;
}
.item-cell { display: flex; align-items: center; gap: 12px; min-width: 220px; }
.row-actions { display: flex; gap: 2px; justify-content: flex-end; }

.empty { padding: 56px 20px; text-align: center; color: var(--mid); }
.empty .empty-icon { width: 44px; height: 44px; margin: 0 auto 12px; border-radius: 14px; background: var(--canvas); display: grid; place-items: center; color: var(--ink); }
.empty h4 { margin: 0 0 4px; color: var(--ink); font-size: 15px; font-weight: 600; }
.empty p { margin: 0 0 16px; }

/* ---------- Lists ---------- */
.list { display: flex; flex-direction: column; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--hairline); }
.list-row:last-child { border-bottom: 0; }
.list-row .grow { flex: 1; min-width: 0; }
.list-row .grow .cell-main { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.bar-row { display: grid; grid-template-columns: 110px 1fr 80px; align-items: center; gap: 12px; padding: 6px 0; }
.bar-row .label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.bar-track { height: 8px; border-radius: 99px; background: var(--canvas); overflow: hidden; }
.bar-track span { display: block; height: 100%; background: var(--ink); border-radius: 99px; }

/* ---------- Chart ---------- */
.chart { width: 100%; height: 260px; display: block; }
.chart .grid-line { stroke: var(--hairline); stroke-width: 1; }
.chart .axis { fill: var(--mid); font-size: 11px; font-family: var(--font); }
.chart .bar-a { fill: #d4d4d4; }
.chart .bar-b { fill: var(--ink); }
.chart .col:hover .bar-a { fill: #bdbdbd; }
.chart .col:hover .bar-b { fill: #404040; }
.chart .hit { fill: transparent; cursor: default; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--mid); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.chart-tip {
  position: fixed; pointer-events: none; z-index: 60;
  background: var(--ink); color: #fafafa; font-size: 12px;
  padding: 8px 10px; border-radius: var(--r-nested); box-shadow: var(--shadow-pop);
  line-height: 1.5;
}
.chart-tip b { font-weight: 600; }

/* ---------- Modal ---------- */
.overlay { position: fixed; inset: 0; background: rgba(10,10,10,0.35); backdrop-filter: blur(2px); z-index: 40; animation: fade .15s; }
.modal {
  position: fixed; z-index: 50; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(620px, calc(100vw - 32px)); max-height: calc(100vh - 48px); overflow-y: auto;
  background: var(--paper); border-radius: var(--r-card); box-shadow: var(--shadow-pop); border: 1px solid var(--hairline);
  animation: pop .18s ease-out;
}
.modal.sm { width: min(420px, calc(100vw - 32px)); }
.modal-head { padding: 20px 20px 0; display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.modal-head h2 { margin: 0; font-size: 18px; font-weight: 600; letter-spacing: -0.015em; }
.modal-head p { margin: 4px 0 0; color: var(--mid); }
.modal-body { padding: 20px; display: grid; gap: 14px; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--hairline); display: flex; justify-content: flex-end; gap: 8px; background: var(--surface-alt); border-radius: 0 0 var(--r-card) var(--r-card); position: sticky; bottom: 0; }
.modal-foot .left { margin-right: auto; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 13px; font-weight: 500; }
.field .hint { font-size: 12px; color: var(--mid); }
.field .input, .field .select { width: 100%; }
.callout { background: var(--surface-alt); border: 1px solid var(--hairline); border-radius: 14px; padding: 12px 14px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.callout .k { font-size: 12px; color: var(--mid); }
.callout .v { font-weight: 600; font-size: 16px; font-variant-numeric: tabular-nums; }

/* ---------- Palette ---------- */
.palette {
  position: fixed; z-index: 55; left: 50%; top: 14vh; transform: translateX(-50%);
  width: min(560px, calc(100vw - 32px)); background: var(--paper); border-radius: var(--r-card);
  border: 1px solid var(--hairline); box-shadow: var(--shadow-pop); overflow: hidden; animation: pop .15s ease-out;
}
.palette-input { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--hairline); }
.palette-input input { flex: 1; border: 0; outline: none; font-size: 15px; background: transparent; }
.palette-list { max-height: 360px; overflow-y: auto; padding: 8px; }
.palette-group { font-size: 12px; color: var(--mid); padding: 8px 10px 4px; }
.palette-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; cursor: pointer; }
.palette-item .i { color: var(--mid); }
.palette-item .meta { margin-left: auto; font-size: 12px; color: var(--mid); }
.palette-item.sel { background: var(--canvas); }

/* ---------- Toasts ---------- */
.toasts { position: fixed; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 70; }
.toast { background: var(--ink); color: #fafafa; padding: 10px 14px; border-radius: 14px; box-shadow: var(--shadow-pop); font-size: 13px; display: flex; align-items: center; gap: 8px; animation: slide .2s ease-out; }
.toast .i { width: 15px; height: 15px; }

@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translate(-50%, -48%) scale(.98); } }
.palette { animation-name: pop2; }
@keyframes pop2 { from { opacity: 0; transform: translateX(-50%) scale(.98); } }
@keyframes slide { from { opacity: 0; transform: translateY(8px); } }

.kv { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--hairline); }
.kv:last-child { border-bottom: 0; }
.kv .v { font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-main, .grid-3 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 820px) {
  .sidebar { position: fixed; left: 0; top: 0; z-index: 45; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow-pop); }
  .sidebar.open { transform: none; }
  .menu-btn { display: inline-grid; }
  .topbar { padding: 0 16px; }
  .view { padding: 20px 16px; }
  .grid-2, .form-grid, .form-grid.three { grid-template-columns: minmax(0, 1fr); }
  .search-input .input { width: 100%; }
  .search-input { flex: 1; }
  .breadcrumb > span:not(.cur), .breadcrumb > svg { display: none; }
}
@media (max-width: 520px) {
  .grid-4 { grid-template-columns: minmax(0, 1fr); }
  .page-head h1 { font-size: 24px; }
}

/* ---------- Line chart ---------- */
.chart .line { fill: none; stroke: var(--ink); stroke-width: 1.75; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { fill: rgba(10,10,10,0.06); }
.chart .guide { stroke: var(--mid-light); stroke-width: 1; stroke-dasharray: 2 3; }
.chart .dot { fill: var(--ink); stroke: var(--paper); stroke-width: 2; }

/* ---------- Comptes ---------- */
.avatar {
  width: 36px; height: 36px; border-radius: 50%; flex: none;
  background: var(--ink); color: #fafafa; display: grid; place-items: center;
  font-size: 12px; font-weight: 600; letter-spacing: 0.02em;
}
.avatar.xs { width: 20px; height: 20px; font-size: 9px; }
.avatar.lg { width: 44px; height: 44px; font-size: 14px; }
.avatar { overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-field { display: flex; align-items: center; gap: 14px; }
.photo-field .avatar.lg { width: 64px; height: 64px; font-size: 20px; }
.photo-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.tab:not(.active) .avatar.xs { background: var(--mid-light); }
.dash-switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: -8px; }
.dash-switch .tab .i { width: 14px; height: 14px; }
.account-card .card-head h3 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.add-card {
  min-height: 220px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  background: transparent; box-shadow: none; border: 1px dashed #d4d4d4; cursor: pointer; color: var(--ink);
  font: inherit; transition: background .15s;
}
.add-card:hover { background: var(--paper); }
.add-card .empty-icon { width: 40px; height: 40px; border-radius: 14px; background: var(--canvas); display: grid; place-items: center; margin-bottom: 8px; }

/* ---------- Articles par lot ---------- */
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.articles-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.articles-bar .search-input.grow { flex: 1; min-width: 240px; }
.articles-bar .search-input.grow .input { width: 100%; background: var(--paper); box-shadow: inset 0 0 0 1px var(--hairline); }
.articles-bar .select { background-color: var(--paper); box-shadow: inset 0 0 0 1px var(--hairline); }
.lots { display: flex; flex-direction: column; gap: 10px; }
.lot { overflow: hidden; transition: box-shadow .15s, opacity .15s; }
.lot.dragging { opacity: .45; }
.lot.drop-before { box-shadow: 0 -3px 0 0 var(--ink), var(--shadow-card); }
.lot.drop-after { box-shadow: 0 3px 0 0 var(--ink), var(--shadow-card); }
.lot-head {
  display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto auto auto;
  align-items: center; gap: 12px; padding: 14px 16px 14px 10px; cursor: pointer; user-select: none;
}
.lot-head:hover { background: var(--surface-alt); }
.drag { color: var(--mid-light); cursor: grab; display: grid; place-items: center; width: 20px; height: 28px; border-radius: 6px; }
.drag:hover { color: var(--ink); background: var(--canvas); }
.drag:active { cursor: grabbing; }
.lot-icon { width: 34px; height: 34px; border-radius: var(--r-nested); background: var(--ink); color: #fafafa; display: grid; place-items: center; }
.lot-icon .i { width: 16px; height: 16px; }
.lot-title { min-width: 0; }
.lot-name { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.lot-name b { font-weight: 600; font-size: 14px; text-transform: uppercase; letter-spacing: 0.01em; }
.lot-stats { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.lot-counts { font-size: 12px; color: var(--mid); }
.lot-counts b { color: var(--ink); font-weight: 500; }
.lot-money { display: flex; align-items: center; gap: 14px; font-size: 12px; color: var(--mid); flex-wrap: wrap; justify-content: flex-end; }
.lot-money b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.pill { font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: var(--r-pill); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pill.pos { background: var(--ink); color: #fafafa; }
.pill.neg { background: #fef2f2; color: var(--ember); box-shadow: inset 0 0 0 1px #fecaca; }
.lot.closed { background: #e9edee; box-shadow: none; }
.lot.closed .lot-head { filter: grayscale(1); opacity: .6; }
.lot.closed .lot-head:hover { background: #e2e7e8; opacity: .8; }
.chev { color: var(--mid); display: grid; place-items: center; transition: transform .2s; }
.lot.open .chev { transform: rotate(90deg); }
.lot-body { border-top: 1px solid var(--hairline); }
.ref { font-family: var(--mono); font-size: 11px; font-weight: 500; background: var(--canvas); color: var(--ink-soft); padding: 2px 7px; border-radius: var(--r-small); white-space: nowrap; }
.art-table td { padding: 9px 16px; }
.art-table th.cb, .art-table td.cb { width: 36px; padding-right: 0; }
th.c, td.c { text-align: center; }
.art-title { max-width: 420px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.art-table tr.selected td { background: #f4f4f4; }
.check { width: 16px; height: 16px; accent-color: var(--ink); cursor: pointer; vertical-align: middle; }
.grade {
  width: 24px; height: 24px; border-radius: 50%; border: 0; cursor: pointer;
  font-size: 11px; font-weight: 600; display: inline-grid; place-items: center; transition: transform .1s;
}
.grade:hover { transform: scale(1.1); }
.grade.g-a { background: var(--ink); color: #fafafa; }
.grade.g-b { background: #d4d4d4; color: var(--ink); }
.grade.g-c { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); }
.grade.g-x { background: var(--canvas); color: var(--mid-light); }
.sel-bar {
  position: sticky; top: 68px; z-index: 8;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  background: var(--ink); color: #fafafa; border-radius: var(--r-card); padding: 10px 12px 10px 20px;
  box-shadow: var(--shadow-pop); font-size: 13px;
}
.sel-bar .spacer { flex: 1; }
.sel-btn { background: rgba(255,255,255,0.1); color: #fafafa; }
.sel-btn:hover { background: rgba(255,255,255,0.2); }
.sel-close { color: #a3a3a3; }
.sel-close:hover { background: rgba(255,255,255,0.1); color: #fafafa; }
.menu {
  position: fixed; z-index: 65; min-width: 190px; padding: 6px;
  background: var(--paper); border: 1px solid var(--hairline); border-radius: 14px; box-shadow: var(--shadow-pop);
  animation: fade .12s;
}
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: transparent; padding: 8px 10px; border-radius: 10px; font-size: 13px; cursor: pointer; text-align: left; }
.menu-item .i { color: var(--mid); width: 15px; height: 15px; }
.menu-item:hover { background: var(--canvas); }
.menu-item.danger { color: var(--ember); }
.menu-item.danger .i { color: var(--ember); }
.menu-sep { height: 1px; background: var(--hairline); margin: 4px 0; }
@media (max-width: 900px) {
  .lot-head { grid-template-columns: auto auto minmax(0, 1fr) auto auto; }
  .lot-stats { grid-column: 3 / -1; grid-row: 2; align-items: flex-start; }
  .lot-money { justify-content: flex-start; }
  .lot-head .chev { display: none; }
}

/* ---------- Fenêtres articles ---------- */
.form-section { font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--mid); margin-top: 4px; }
.qty-box { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: var(--surface-alt); border: 1px solid var(--hairline); border-radius: 18px; padding: 14px 16px; }
.qty-box label { font-weight: 500; }
.qty-box .input { width: 96px; text-align: center; font-weight: 600; font-size: 16px; background: var(--paper); box-shadow: inset 0 0 0 1px var(--hairline); }
.pick-list { border: 1px solid var(--hairline); border-radius: 18px; max-height: 300px; overflow-y: auto; }
.pick-row {
  display: grid; grid-template-columns: 24px 64px minmax(0, 1fr) auto; align-items: center; gap: 12px;
  width: 100%; padding: 10px 14px; border: 0; border-bottom: 1px solid var(--hairline); background: transparent; text-align: left; cursor: pointer;
}
.pick-row:last-child { border-bottom: 0; }
.pick-row:hover { background: var(--surface-alt); }
.pick-row.on { background: #f4f4f4; }
.pick-dot { width: 20px; height: 20px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--mid-light); display: grid; place-items: center; color: #fafafa; }
.pick-dot .i { width: 12px; height: 12px; stroke-width: 3; }
.pick-row.on .pick-dot { background: var(--ink); box-shadow: none; }
.pick-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.pick-status { font-size: 12px; color: var(--mid); }
.pick-more { padding: 12px 14px; font-size: 13px; color: var(--mid); text-align: center; }
.drag-space { width: 20px; }

/* ---------- Finance ---------- */
.fin-nav { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.fin-step { display: flex; align-items: center; gap: 4px; background: var(--paper); border: 1px solid var(--hairline); border-radius: var(--r-pill); padding: 2px; }
.fin-step .icon-btn[disabled] { opacity: .3; cursor: default; }
.fin-label { min-width: 150px; text-align: center; font-weight: 500; font-size: 13px; }
.split-bar { display: flex; height: 28px; border-radius: 10px; overflow: hidden; gap: 2px; background: var(--canvas); }
.split-bar span { display: block; height: 100%; min-width: 3px; transition: width .4s; }
.split-legend { margin-top: 18px; display: flex; flex-direction: column; }
.split-row { display: grid; grid-template-columns: 12px minmax(0, 1fr) 48px 96px; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--hairline); }
.split-row i { width: 12px; height: 12px; border-radius: 4px; box-shadow: inset 0 0 0 1px rgba(0,0,0,0.06); }
.split-row .muted { text-align: right; font-size: 12px; }
.split-row .v { text-align: right; font-weight: 500; }
.split-row.total { border-bottom: 0; padding-top: 12px; }
.split-row.total .grow, .split-row.total .v { font-weight: 600; font-size: 15px; }
.list-row.inactive { opacity: .5; }
.badge-btn { border: 0; cursor: pointer; font-family: inherit; }
.badge-btn .i { width: 12px; height: 12px; }
.badge-late { background: #fef2f2; color: var(--ember); box-shadow: inset 0 0 0 1px #fecaca; }

/* ---------- Factures ---------- */
.dropzone {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px; cursor: pointer;
  border: 1px dashed #c4c4c4; border-radius: 18px; background: var(--surface-alt); transition: background .15s, border-color .15s;
}
.dropzone:hover, .dropzone.over { background: var(--canvas); border-color: var(--ink); }
.dropzone > .i { width: 20px; height: 20px; color: var(--mid); }
.dropzone .muted { font-size: 12px; }
.inv-list { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.inv-list:empty { display: none; }
.inv-row { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto auto; align-items: center; gap: 10px; padding: 6px 6px 6px 10px; border: 1px solid var(--hairline); border-radius: 14px; font-size: 13px; }
.inv-ico { width: 28px; height: 28px; border-radius: 8px; background: var(--canvas); display: grid; place-items: center; }
.inv-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.modal.lg { width: min(980px, calc(100vw - 32px)); }
.viewer-tabs { padding: 14px 20px 0; overflow-x: auto; }
.viewer { margin: 16px 20px 20px; border: 1px solid var(--hairline); border-radius: 14px; overflow: hidden; background: var(--canvas); display: grid; place-items: center; min-height: 300px; }
.viewer iframe { width: 100%; height: 68vh; border: 0; background: var(--paper); }
.viewer img { max-width: 100%; max-height: 68vh; display: block; }
.split-row { grid-template-columns: 12px minmax(0, 1fr) 64px 96px; }
.quick-add { display: flex; gap: 8px; flex-wrap: wrap; padding: 16px 20px; border-bottom: 1px solid var(--hairline); margin-top: 16px; border-top: 1px solid var(--hairline); background: var(--surface-alt); }
.quick-add .grow { flex: 1; min-width: 220px; }
.quick-add .input, .quick-add .select { background-color: var(--paper); box-shadow: inset 0 0 0 1px var(--hairline); }
.quick-add .qa-amount { width: 120px; }
.quick-add .qa-date { width: 150px; }
.choice { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; text-align: left; padding: 14px 16px; border: 1px solid var(--hairline); border-radius: 16px; background: var(--paper); cursor: pointer; font: inherit; transition: background .15s, border-color .15s; }
.choice:hover { background: var(--surface-alt); border-color: var(--ink); }
.choice b { font-weight: 600; }
.choice .muted { font-size: 13px; }
.goal-head .goal-edit { margin-left: auto; }
.goal-edit { width: 26px; height: 26px; margin: -4px -6px -4px 0; }
.goal-edit .i { width: 14px; height: 14px; }
.goal-form { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.goal-form .input { width: 120px; font-weight: 600; }
.nav a .ext { width: 13px; height: 13px; margin-left: auto; opacity: .6; }

/* =========================================================
   Couleurs Vinted
   ========================================================= */
::selection { background: var(--brand-soft); color: var(--brand-ink); }

/* Barre latérale */
.sidebar { background: var(--paper); }
.brand-mark { background: var(--brand); box-shadow: 0 4px 12px -4px rgba(0, 119, 130, 0.55); }
.nav a .i { color: #8a9a9c; }
.nav a:hover { background: var(--brand-softer); color: var(--brand-ink); }
.nav a.active { background: var(--brand-soft); color: var(--brand-ink); box-shadow: none; position: relative; }
.nav a.active::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--brand); }
.nav a.active .i { color: var(--brand); }
.nav-count.hot { background: var(--brand); }
.search-trigger { background: var(--canvas); }
.search-trigger:hover { background: var(--brand-softer); color: var(--brand-ink); }

/* Boutons et champs */
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-hover); }
.btn-secondary:hover { background: var(--brand-soft); color: var(--brand-ink); }
.btn-outline:hover { background: var(--brand-softer); box-shadow: inset 0 0 0 1px var(--brand-light); color: var(--brand-ink); }
.icon-btn:hover { background: var(--brand-soft); color: var(--brand); }
.input:focus, .select:focus { box-shadow: inset 0 0 0 1px var(--brand), 0 0 0 3px rgba(0, 119, 130, 0.12); }
.check { accent-color: var(--brand); }
a.btn { text-decoration: none; }

/* Onglets */
.tab.active { color: var(--brand-ink); }
.tab:hover { color: var(--brand); }

/* Cartes et indicateurs */
.stat-label .i { color: var(--brand); }
.stat:hover { box-shadow: 0 0 0 1px rgba(0, 119, 130, 0.12), 0 6px 18px -8px rgba(0, 77, 84, 0.25); }
.card.stat { transition: box-shadow .2s; }
.delta { color: var(--brand); }
.delta.down { color: var(--ember); }
.progress { background: var(--brand-soft); }
.progress > span { background: var(--brand); }
.bar-track { background: var(--brand-soft); }
.bar-track span { background: var(--brand); }
.empty .empty-icon { background: var(--brand-soft); color: var(--brand); }

/* Badges et statuts */
.badge-solid { background: var(--brand); color: #fff; }
.badge-outline.badge-dot { background: var(--brand-soft); color: var(--brand-ink); box-shadow: none; }
.badge-soft.badge-dot { background: var(--amber-soft); color: var(--amber); }
.badge-soft { background: var(--brand-softer); color: var(--brand-ink); }
.ref { background: var(--brand-soft); color: var(--brand-ink); }
.pill.pos { background: var(--brand); color: #fff; }
.grade.g-a { background: var(--brand); color: #fff; }
.grade.g-b { background: var(--brand-light); color: var(--brand-ink); }
.grade.g-c { box-shadow: inset 0 0 0 1.5px var(--amber); color: var(--amber); }

/* Avatars et icônes de lots */
.avatar { background: var(--brand); color: #fff; }
.tab:not(.active) .avatar.xs { background: #e4e9ea; color: #6b7c80; }
.lot-icon { background: var(--brand-soft); color: var(--brand); }
.thumb { background: var(--brand-softer); color: var(--brand); }

/* Graphiques */
.chart .bar-a { fill: var(--brand-light); }
.chart .bar-b { fill: var(--brand); }
.chart .col:hover .bar-a { fill: #6fc2c8; }
.chart .col:hover .bar-b { fill: var(--brand-hover); }
.chart .line { stroke: var(--brand); stroke-width: 2; }
.chart .area { fill: rgba(0, 119, 130, 0.1); }
.chart .dot { fill: var(--brand); }
.chart-tip { background: var(--brand-ink); }

/* Barres d'action, notifications, menus */
.sel-bar { background: var(--brand-ink); }
.toast { background: var(--brand-ink); }
.menu-item:hover { background: var(--brand-softer); }
.palette-item.sel { background: var(--brand-soft); }
.choice:hover { border-color: var(--brand); background: var(--brand-softer); }
.dropzone:hover, .dropzone.over { border-color: var(--brand); background: var(--brand-softer); }
.pick-row.on { background: var(--brand-softer); }
.pick-row.on .pick-dot { background: var(--brand); }
.qty-box { background: var(--brand-softer); border-color: var(--brand-soft); }

/* Bandeau de démonstration */
.demo-banner { background: var(--brand); border: 0; color: #fff; }
.demo-banner .cell-sub { color: rgba(255, 255, 255, 0.8); }
.demo-banner .empty-icon { background: rgba(255, 255, 255, 0.18) !important; color: #fff; }
.demo-banner .btn-secondary { background: rgba(255, 255, 255, 0.16); color: #fff; }
.demo-banner .btn-secondary:hover { background: rgba(255, 255, 255, 0.26); color: #fff; }
.demo-banner .btn-primary { background: #fff; color: var(--brand-ink); }
.demo-banner .btn-primary:hover { background: var(--brand-soft); }

/* En-tête de page */
.page-head h1 { color: var(--ink); }
.topbar { background: rgba(243, 246, 246, 0.85); }
.breadcrumb .cur { color: var(--ink); }

/* Statuts des articles */
.st { font-weight: 600; padding: 2px 10px; }
.st-active { background: var(--ok-soft); color: var(--ok); }
.st-sold { background: var(--sold-soft); color: var(--sold); }
.st-draft { background: var(--draft-soft); color: var(--draft); }
.st-dispute { background: var(--bad-soft); color: var(--bad); }

/* Grades */
.grade.g-a { background: var(--ok-soft); color: var(--ok); box-shadow: none; }
.grade.g-b { background: var(--warn-soft); color: var(--warn); box-shadow: none; }
.grade.g-c { background: var(--bad-soft); color: var(--bad); box-shadow: none; }
.grade.g-x { background: #e9eef0; color: #6b7c80; }

/* En-tête des commandes */
.lot-counts b { margin-left: 10px; font-weight: 500; }
.lot-counts .c-active { color: var(--ok); }
.lot-counts .c-sold { color: var(--sold); }
.lot-counts .c-dispute { color: var(--bad); }
.lot-money .c-forecast { color: var(--sold); }
.lot-money .c-ca { color: var(--info); }
.pill { font-weight: 700; padding: 4px 12px; }
.pill.pos { background: var(--ok-soft); color: var(--ok); box-shadow: inset 0 0 0 1.5px var(--ok-line); }
.pill.neg { background: var(--bad-soft); color: var(--bad); box-shadow: inset 0 0 0 1.5px var(--bad-line); }

/* Marge */
.c-mult { color: var(--ok); font-weight: 600; }
.c-none { color: #8a9a9c; }
.sale-ref { font-size: 12px; padding: 3px 9px; min-width: 52px; text-align: center; }
.tab.active .avatar.xs { background: var(--brand); color: #fff; }

/* ---------- Générateur de fiche ---------- */
.fiche-form { display: grid; gap: 14px; }
.fiche-genre { display: flex; }
.fiche-genre .tab { flex: 1; justify-content: center; }
.fiche-out .field, .fiche-out textarea.input, .fiche-out .input { width: 100%; }
.fiche-out .card-head { padding-top: 16px; }
.fiche-out .card-body { padding: 12px 20px 20px; }
.fiche-out textarea.input { line-height: 1.5; }
.fiche-title { background: var(--brand-softer); border-color: var(--brand-light); }
.fiche-title h3 { color: var(--brand); }
.fiche-title .input { background: var(--paper); font-weight: 600; font-size: 15px; }
.fiche-text { margin: 0; line-height: 1.55; }
.btn[disabled] { opacity: .45; cursor: default; }

/* ---------- Connexion par code ---------- */
body.locked .app { display: none; }
.login { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px; background: var(--canvas); }
.login-card {
  width: min(380px, 100%); display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center;
  background: var(--paper); border: 1px solid var(--hairline); border-radius: var(--r-card); box-shadow: var(--shadow-card); padding: 36px 28px 28px;
}
.login-mark { width: 52px; height: 52px; border-radius: 16px; font-size: 22px; margin-bottom: 4px; }
.login-card h1 { margin: 0; font-size: 24px; letter-spacing: -0.025em; }
.login-card p { margin: 0 0 8px; }
.login-card .input { width: 100%; text-align: center; height: 44px; font-size: 16px; letter-spacing: 0.2em; }
.login-card .btn { height: 44px; }
.login-error { color: var(--ember); font-size: 13px; margin: 4px 0 0 !important; }

/* ---------- Indicateur de synchronisation ---------- */
.sync-bar { display: flex; align-items: center; gap: 8px; padding: 10px 10px 2px; margin-top: 8px; border-top: 1px solid var(--hairline); font-size: 12px; color: var(--mid); }
.sync-bar #syncText { flex: 1; }
.sync-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex: none; }
.sync-bar.busy .sync-dot { background: var(--amber); }
.sync-bar.error .sync-dot { background: var(--ember); }
.sync-bar.error { color: var(--ember); }
