:root {
  --bg: #0f1115;
  --surface: #181b22;
  --surface2: #222631;
  --border: #2d3240;
  --text: #e9ebf1;
  --muted: #8b93a7;
  --accent: #14b8a6;
  --accent-ink: #032b28;
  --green: #22c55e;
  --orange: #f59e0b;
  --red: #ef4444;
  --grey: #64748b;
  --radius: 14px;
  --tabs-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: dark;
}

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

html,
body {
  margin: 0;
  height: 100%;
  background: #08090c;
  color: var(--text);
  font: 15px/1.45 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

body {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  max-width: 560px;
  margin: 0 auto;
  background: var(--bg);
  overflow: hidden;
  overscroll-behavior: none;
}

[hidden] {
  display: none !important;
}

svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

a {
  color: var(--accent);
}

/* ───────────── Structure ───────────── */
main {
  flex: 1;
  position: relative;
  overflow: hidden;
}

.view {
  position: absolute;
  inset: 0;
  display: none;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.view.active {
  display: block;
}

.tabs {
  display: flex;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding-bottom: var(--safe-b);
  z-index: 10;
}

.tabs button {
  flex: 1;
  height: var(--tabs-h);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: none;
  border: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.tabs button.on {
  color: var(--accent);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(var(--safe-t) + 14px) 16px 10px;
  background: var(--bg);
}

.topbar h1 {
  margin: 0;
  font-size: 24px;
  letter-spacing: -0.02em;
}

.toolbar {
  padding: 0 16px 10px;
}

/* ───────────── Vue Vérifier (Recherche instantanée) ───────────── */
.lookup-header {
  position: sticky;
  top: 0;
  z-index: 8;
  padding: calc(var(--safe-t) + 14px) 16px 12px;
  background: rgba(15, 17, 21, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(45, 50, 64, 0.6);
}

.lookup-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.lookup-title-row h1 {
  margin: 0;
  font-size: 22px;
  letter-spacing: -0.02em;
}

.db-pill {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  background: rgba(20, 184, 166, 0.14);
  border: 1px solid rgba(20, 184, 166, 0.3);
  padding: 3px 10px;
  border-radius: 999px;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-box .search-ico {
  position: absolute;
  left: 14px;
  width: 22px;
  height: 22px;
  color: var(--muted);
  pointer-events: none;
}

#lookupInput {
  width: 100%;
  padding: 15px 46px 15px 44px;
  font-size: 18px;
  font-weight: 600;
  background: var(--surface2);
  border: 2px solid var(--border);
  border-radius: 16px;
  color: var(--text);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  transition: border-color 0.15s, box-shadow 0.15s;
}

#lookupInput::placeholder {
  font-weight: 400;
  font-size: 15px;
  color: var(--muted);
}

#lookupInput:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(20, 184, 166, 0.18);
}

/* Masque la croix native webkit pour n'avoir que notre gros bouton ✕ */
#lookupInput::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
}

.clear-btn {
  position: absolute;
  right: 8px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 0;
  background: var(--border);
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
  display: grid;
  place-items: center;
}

.clear-btn:active {
  transform: scale(0.92);
}

.lookup-content {
  padding: 14px 16px calc(var(--tabs-h) + 32px);
}

/* ───────────── Grande Carte Verdict ───────────── */
.verdict-card {
  background: var(--surface);
  border-radius: 20px;
  overflow: hidden;
  border: 2px solid var(--border);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  margin-bottom: 18px;
  animation: card-pop 0.14s ease-out;
}

.verdict-card.green { border-color: rgba(34, 197, 94, 0.55); }
.verdict-card.orange { border-color: rgba(245, 158, 11, 0.55); }
.verdict-card.red { border-color: rgba(239, 68, 68, 0.55); }

@keyframes card-pop {
  from { opacity: 0.6; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.verdict-band {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 18px;
  color: #fff;
}

.verdict-band.green { background: linear-gradient(135deg, #15803d, #22c55e); }
.verdict-band.orange { background: linear-gradient(135deg, #b45309, #f59e0b); }
.verdict-band.red { background: linear-gradient(135deg, #991b1b, #ef4444); }

.verdict-ico {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.22);
  flex-shrink: 0;
}

.verdict-ico svg {
  width: 32px;
  height: 32px;
  stroke-width: 3;
}

.verdict-txt {
  flex: 1;
  min-width: 0;
}

.verdict-txt span {
  display: block;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.95;
}

.verdict-txt h2 {
  margin: 2px 0 0;
  font-size: 28px;
  line-height: 1.12;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}

.matched-alias {
  display: inline-block;
  margin-top: 4px;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.25);
  font-size: 12px;
  font-weight: 600;
}

.verdict-body {
  padding: 16px 18px 18px;
}

.price-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 16px;
  margin-bottom: 12px;
}

.price-box span {
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}

.price-box b {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  white-space: nowrap;
}

.advice-box {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 12px;
}

.advice-box span {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 4px;
}

.advice-box p {
  margin: 0;
  font-size: 15px;
  line-height: 1.45;
}

.aliases-line {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

kbd {
  display: inline-block;
  padding: 2px 7px;
  font-size: 12px;
  font-family: inherit;
  font-weight: 600;
  color: var(--text);
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.tips-card kbd {
  cursor: pointer;
  color: var(--accent);
  border-color: rgba(20, 184, 166, 0.35);
}

.verdict-actions {
  display: flex;
  gap: 10px;
}

.verdict-actions .btn {
  flex: 1;
}

/* ───────────── Sections & Accueil Vérifier ───────────── */
.lookup-section {
  margin-top: 18px;
}

.section-title {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 10px;
}

.lookup-list {
  padding: 0 !important;
}

.alias-tag {
  font-weight: 500;
  color: var(--muted);
  font-size: 13px;
}

.summary-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.sum-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 14px 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  text-align: center;
}

.sum-card:active {
  background: var(--surface2);
}

.sum-card b {
  font-size: 24px;
  font-weight: 800;
  line-height: 1.1;
}

.sum-card.green b { color: var(--green); }
.sum-card.orange b { color: var(--orange); }
.sum-card.red b { color: var(--red); }

.sum-card span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.sum-card .dot {
  width: 8px;
  height: 8px;
  box-shadow: none;
}

.recent-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tips-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px 16px;
  color: var(--muted);
  font-size: 14px;
}

.tips-card p {
  margin: 0 0 8px;
}

.tips-card p:last-child {
  margin-bottom: 0;
}

.tips-card b {
  color: var(--text);
}

/* ───────────── Ajout rapide & Évaluation IA ───────────── */
.quick-add-card {
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: 18px;
  padding: 16px;
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.quick-add-head b {
  display: block;
  font-size: 16px;
  margin-bottom: 2px;
}

.quick-add-head small {
  color: var(--muted);
  font-size: 13px;
}

.ai-btn {
  background: linear-gradient(135deg, #7c3aed, #6366f1);
  border-color: transparent;
  color: #fff;
  padding: 14px;
  font-size: 15px;
  box-shadow: 0 6px 20px rgba(124, 58, 237, 0.3);
}

.Quick-rate-row,
.quick-rate-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.qrate {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 8px;
  border-radius: 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  text-align: left;
}

.qrate:active {
  transform: scale(0.97);
}

.qrate span {
  display: flex;
  flex-direction: column;
  font-weight: 700;
  font-size: 13px;
  line-height: 1.15;
}

.qrate small {
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
}

.full-w {
  width: 100%;
}

/* ───────────── Listes ───────────── */
.list {
  list-style: none;
  margin: 0;
  padding: 0 12px calc(var(--tabs-h) + 40px);
}

.item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  margin-bottom: 8px;
  background: var(--surface);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.15s;
}

.item:active {
  background: var(--surface2);
}

.item .grow {
  flex: 1;
  min-width: 0;
}

.item b {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item small {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-top: 2px;
}

.item small strong {
  color: var(--text);
}

.item .chev {
  color: var(--muted);
  width: 18px;
  height: 18px;
}

.dot {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--grey);
}

.dot.green { background: var(--green); box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.18); }
.dot.orange { background: var(--orange); box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.18); }
.dot.red { background: var(--red); box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.18); }

.thumb {
  width: 46px;
  height: 46px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--surface2);
}

.thumb.ph {
  display: grid;
  place-items: center;
  font-weight: 800;
  color: #fff;
}
.thumb.ph.green { background: #15803d; }
.thumb.ph.orange { background: #b45309; }
.thumb.ph.red { background: #b91c1c; }
.thumb.ph.unknown { background: #475569; }

.badge {
  display: inline-block;
  padding: 1px 8px;
  margin-right: 4px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}
.badge.green { background: rgba(34, 197, 94, 0.15); color: var(--green); }
.badge.orange { background: rgba(245, 158, 11, 0.15); color: var(--orange); }
.badge.red { background: rgba(239, 68, 68, 0.15); color: var(--red); }
.badge.unknown { background: rgba(100, 116, 139, 0.2); color: #a3afc2; }

.icon.del {
  color: var(--muted);
  font-size: 14px;
}

.empty {
  text-align: center;
  color: var(--muted);
  padding: 48px 20px;
  list-style: none;
}

.empty svg {
  width: 44px;
  height: 44px;
  opacity: 0.5;
}

.empty p {
  margin: 10px 0 4px;
  color: var(--text);
}

.stats {
  display: flex;
  align-items: center;
  gap: 18px;
  font-weight: 700;
}

.stats span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.muted {
  color: var(--muted);
  font-weight: 500;
}

/* ───────────── Barre d'outils marques & Formulaires ───────────── */
input[type='search'],
input[type='text'],
input[type='password'],
input[type='number'],
input:not([type]),
select,
textarea {
  width: 100%;
  padding: 12px 14px;
  font-size: 16px; /* évite le zoom auto sur iOS */
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 12px;
  outline: none;
  transition: border-color 0.15s;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
}

textarea {
  resize: vertical;
}

.chips {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  overflow-x: auto;
  scrollbar-width: none;
}

.chips::-webkit-scrollbar {
  display: none;
}

.chips button,
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  white-space: nowrap;
  font-size: 14px;
  font-weight: 600;
}

.chips button .dot,
.chip .dot {
  width: 10px;
  height: 10px;
  box-shadow: none;
}

.chips button b {
  color: var(--muted);
  font-weight: 600;
}

.chips button.on {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

.chips button.on b {
  color: inherit;
  opacity: 0.6;
}

.fab {
  position: fixed;
  right: max(16px, calc(50vw - 280px + 16px));
  bottom: calc(var(--tabs-h) + var(--safe-b) + 18px);
  width: 58px;
  height: 58px;
  border-radius: 18px;
  border: 0;
  background: var(--accent);
  color: var(--accent-ink);
  display: grid;
  place-items: center;
  box-shadow: 0 8px 24px rgba(20, 184, 166, 0.35);
  z-index: 6;
}

.fab svg {
  width: 28px;
  height: 28px;
  stroke-width: 2.5;
}

.menu-wrap {
  position: relative;
}

.menu {
  position: absolute;
  right: 0;
  top: 44px;
  min-width: 250px;
  padding: 6px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
  z-index: 20;
}

.menu button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 11px 12px;
  border: 0;
  border-radius: 10px;
  background: none;
}

.menu button:hover {
  background: var(--border);
}

/* ───────────── Boutons ───────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface2);
  font-weight: 600;
  white-space: nowrap;
}

.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.btn.ghost {
  background: transparent;
}

.btn.danger-fill {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}

.danger {
  color: var(--red) !important;
}

.text-btn {
  background: none;
  border: 0;
  font-weight: 600;
  padding: 8px;
}

.icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 10px;
  background: none;
  color: var(--text);
  flex-shrink: 0;
}

/* ───────────── Boîtes de dialogue ───────────── */
.dlg {
  border: 0;
  padding: 0;
  width: min(92vw, 480px);
  max-height: 88dvh;
  background: var(--surface);
  color: var(--text);
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

.dlg::backdrop {
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.dlg-inner {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
}

.dlg-inner header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dlg-inner h2 {
  margin: 0;
  font-size: 19px;
}

.dlg-msg {
  margin: 0;
  color: var(--muted);
}

.dlg-inner footer {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.dlg-inner footer.stack {
  flex-direction: column;
  align-items: stretch;
}

.spacer {
  flex: 1;
}

.field {
  display: block;
}

.field > span {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 6px;
}

.field small {
  font-weight: 400;
}

.inline {
  display: flex;
  align-items: center;
  gap: 8px;
}

.inline input {
  flex: 1;
  min-width: 0;
}

.rating-pick {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.rating-pick input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.rating-pick span {
  display: grid;
  place-items: center;
  min-height: 48px;
  padding: 8px 6px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  border-radius: 12px;
  background: var(--surface2);
  border: 2px solid transparent;
  cursor: pointer;
}

.rating-pick .green span { color: var(--green); }
.rating-pick .orange span { color: var(--orange); }
.rating-pick .red span { color: var(--red); }
.rating-pick .green input:checked + span { background: var(--green); color: #052e14; }
.rating-pick .orange input:checked + span { background: var(--orange); color: #3b2101; }
.rating-pick .red input:checked + span { background: var(--red); color: #fff; }
.rating-pick input:focus-visible + span { border-color: var(--text); }

/* ───────────── Réglages ───────────── */
.settings {
  padding: 0 16px calc(var(--tabs-h) + 24px);
}

.settings fieldset {
  border: 0;
  margin: 0 0 14px;
  padding: 14px 16px;
  background: var(--surface);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.settings legend {
  float: left;
  width: 100%;
  padding: 0;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 0;
  cursor: pointer;
}

.switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch i {
  position: relative;
  width: 48px;
  height: 28px;
  border-radius: 999px;
  background: var(--border);
  transition: background 0.2s;
}

.switch i::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s;
}

.switch input:checked + i {
  background: var(--accent);
}

.switch input:checked + i::after {
  transform: translateX(20px);
}

.note {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

.note.warn { color: var(--orange); }
.note.ok { color: var(--green); }
.center { text-align: center; }

/* ───────────── Toast ───────────── */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tabs-h) + var(--safe-b) + 20px);
  transform: translateX(-50%);
  max-width: min(90vw, 480px);
  padding: 11px 18px;
  border-radius: 14px;
  background: #f1f3f7;
  color: #111;
  font-weight: 600;
  font-size: 14px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  z-index: 100;
  animation: toast-in 0.2s ease-out;
}

.toast.error { background: var(--red); color: #fff; }
.toast.ok { background: #15803d; color: #fff; }

@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, 10px); }
}

@media (min-width: 561px) {
  body {
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
  }
}

/* ───────────── Scanner d'opportunités (Ventes Vinted / Comps) ───────────── */
.topbar-sub {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.comps-wrap {
  padding: 0 16px calc(var(--tabs-h) + 32px);
}

.comps-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.comps-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.comps-grid-4 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.comps-piece-chips {
  margin-top: 2px;
}

.comps-piece-chips button {
  padding: 5px 12px;
  font-size: 13px;
}

.comps-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.comps-actions .btn.primary {
  flex: 1;
}

.comps-result {
  margin-top: 14px;
}

.demo-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: rgba(20, 184, 166, 0.12);
  border: 1px solid rgba(20, 184, 166, 0.35);
  border-radius: 12px;
  padding: 10px 14px;
  margin-bottom: 12px;
  font-size: 13px;
}

.comps-kpis {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.kpi-card.highlight {
  border-color: rgba(20, 184, 166, 0.5);
  background: linear-gradient(145deg, rgba(20, 184, 166, 0.14), var(--surface));
}

.kpi-card > span {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.kpi-card > b {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.15;
}

.kpi-card > small {
  font-size: 12px;
  color: var(--muted);
}

.sourcing-calc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 14px;
}

.sourcing-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.sourcing-box {
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--surface2);
  border-left: 4px solid var(--grey);
}

.sourcing-box.green { border-left-color: var(--green); }
.sourcing-box.orange { border-left-color: var(--orange); }

.sourcing-box span {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
}

.sourcing-box b {
  display: block;
  font-size: 18px;
  font-weight: 800;
  margin: 2px 0;
}

.sourcing-box small {
  font-size: 12px;
  color: var(--accent);
  font-weight: 600;
}

.st-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.st-row {
  display: grid;
  grid-template-columns: 68px 1fr auto;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.st-days {
  font-weight: 700;
  color: var(--muted);
}

.st-bar-wrap {
  height: 8px;
  background: var(--surface2);
  border-radius: 99px;
  overflow: hidden;
}

.st-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 99px;
}

.st-pct {
  font-size: 13px;
}

.st-prices {
  grid-column: 2 / -1;
  color: var(--muted);
  font-size: 11px;
  margin-top: -4px;
}

.comps-items-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.comps-sort {
  display: inline-flex;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 2px;
}

.comps-sort button {
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  padding: 5px 9px;
  border-radius: 8px;
}

.comps-sort button.on {
  background: var(--surface2);
  color: var(--text);
}

.sold-item {
  cursor: default;
}

.sold-price-col {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}

.sold-price {
  font-size: 16px;
  font-weight: 800;
  color: var(--green);
}

.sold-link {
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--surface2);
  color: var(--accent);
}
