/* =================================================================
   RESALE ARBITRAGE CRM — Design System v4
   Mobile-first · Clean · Professional
   ================================================================= */

/* System font stack — no external font load, instant render */

:root {
  color-scheme: light;
  /* ── Base palette ─────────────────────────────────────────────── */
  --bg:           #f4f6f9;
  --surface:      #ffffff;
  --surface-soft: #f9fafb;
  --surface-strong:#f0f3f7;
  --line:         #e4e9f0;
  --line-strong:  #d0d8e4;
  /* ── Text ────────────────────────────────────────────────────── */
  --text:         #0f172a;
  --muted:        #64748b;
  --muted-strong: #334155;
  /* ── Accent — vivid emerald ──────────────────────────────────── */
  --accent:       #10b981;
  --accent-hover: #059669;
  --accent-strong:#047857;
  --accent-soft:  #d1fae5;
  /* ── Buy / Sell status ───────────────────────────────────────── */
  --buy-bg:       #dcfce7; --buy-text: #166534; --buy-border: #86efac;
  --rev-bg:       #fef9c3; --rev-text: #713f12; --rev-border: #fde047;
  --rej-bg:       #fee2e2; --rej-text: #991b1b; --rej-border: #fca5a5;
  /* ── Semantic ────────────────────────────────────────────────── */
  --danger:       #ef4444;  --danger-soft:  #fee2e2;
  --warning:      #f59e0b;  --warning-soft: #fef3c7;
  --success:      #10b981;  --success-soft: #d1fae5;
  --blue:         #3b82f6;  --blue-soft:    #eff6ff;
  --violet:       #8b5cf6;  --violet-soft:  #ede9fe;
  --orange:       #f97316;
  /* ── Sidebar ─────────────────────────────────────────────────── */
  --sidebar-bg:   #0f172a;
  --sidebar-border:#1e293b;
  --sidebar-text: #94a3b8;
  --sidebar-active:#ffffff;
  --sidebar-hover:rgba(255,255,255,0.06);
  /* ── Geometry ────────────────────────────────────────────────── */
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  /* ── Shadows ─────────────────────────────────────────────────── */
  --shadow-xs: 0 1px 3px rgba(15,23,42,0.07);
  --shadow-sm: 0 4px 12px rgba(15,23,42,0.08);
  --shadow:    0 8px 24px rgba(15,23,42,0.10);
  --shadow-lg: 0 20px 48px rgba(15,23,42,0.14);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button, input, select, textarea { font: inherit; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-strong); }

/* ══════════════════════════════════════════════════════════════════
   BUTTONS
   ══════════════════════════════════════════════════════════════════ */
button {
  min-height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  padding: 0 16px;
  font-weight: 600;
  font-size: 13.5px;
  letter-spacing: -0.01em;
  transition: all 0.15s ease;
  box-shadow: var(--shadow-xs);
}
button:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
  background: var(--accent-soft);
  box-shadow: var(--shadow-sm);
}
button:active { transform: scale(0.98); box-shadow: none; }
button:disabled { opacity: 0.45; cursor: not-allowed; pointer-events: none; }

button.primary {
  background: var(--accent);
  border-color: var(--accent-hover);
  color: #fff;
  box-shadow: 0 2px 8px rgba(16,185,129,0.30);
}
button.primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-strong);
  color: #fff;
  box-shadow: 0 4px 14px rgba(16,185,129,0.40);
}
button.danger {
  background: var(--danger-soft);
  border-color: #fca5a5;
  color: var(--danger);
  box-shadow: none;
}
button.danger:hover { background: #fecaca; border-color: var(--danger); }

.link-button {
  min-height: auto; border: 0; background: transparent;
  padding: 0; color: var(--blue); font-weight: 700;
  box-shadow: none; white-space: normal; text-align: left;
}
.link-button:hover { color: var(--accent-strong); background: transparent; box-shadow: none; }

.btn-link {
  display: inline-flex; align-items: center;
  padding: 6px 12px; border-radius: var(--radius-sm);
  background: var(--blue-soft); border: 1px solid #bfdbfe;
  color: var(--blue); font-size: 13px; font-weight: 600;
  text-decoration: none; white-space: nowrap;
  transition: background 0.13s, border-color 0.13s;
}
.btn-link:hover { background: #dbeafe; border-color: var(--blue); }

.btn-mini {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 28px; height: 28px; width: 28px;
  padding: 0; border-radius: var(--radius-xs);
  border: 1px solid var(--line); background: var(--surface);
  font-size: 13px; box-shadow: none; text-decoration: none;
}
.btn-mini:hover { border-color: var(--accent); background: var(--accent-soft); box-shadow: none; }
.btn-buy { border-color: var(--buy-border); background: var(--buy-bg); color: var(--buy-text); }

.btn-sm {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 12px; font-size: 12.5px; font-weight: 600;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); cursor: pointer;
  text-decoration: none; transition: all 0.13s; white-space: nowrap;
  box-shadow: var(--shadow-xs);
}
.btn-sm:hover { background: var(--surface-strong); border-color: var(--accent); }
.btn-sm.primary { background: var(--accent); color: #fff; border-color: var(--accent-hover); box-shadow: 0 2px 6px rgba(16,185,129,0.25); }
.btn-sm.primary:hover { background: var(--accent-hover); }

/* ══════════════════════════════════════════════════════════════════
   FORMS
   ══════════════════════════════════════════════════════════════════ */
label {
  display: grid; gap: 5px;
  color: var(--muted-strong); font-size: 12px; font-weight: 600;
}
input, select, textarea {
  width: 100%; min-height: 40px;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text);
  padding: 0 12px; font-size: 14px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(16,185,129,0.16);
}
textarea { min-height: 90px; padding: 10px 12px; resize: vertical; }

.form-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.section-hint { font-size: 12.5px; color: var(--muted); margin: -2px 0 10px; line-height: 1.5; }
.inline-status { color: var(--muted); font-size: 13px; }

/* ══════════════════════════════════════════════════════════════════
   APP SHELL — LAYOUT
   ══════════════════════════════════════════════════════════════════ */
.app-shell {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  min-height: 100vh;
}

/* ══════════════════════════════════════════════════════════════════
   SIDEBAR
   ══════════════════════════════════════════════════════════════════ */
.sidebar {
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  display: grid;
  grid-template-rows: auto 1fr auto;
  position: sticky; top: 0;
  height: 100vh; overflow-y: auto;
}
.brand-lockup {
  display: flex; align-items: center; gap: 12px;
  padding: 22px 18px 18px;
  border-bottom: 1px solid var(--sidebar-border);
}
.app-mark {
  width: 38px; height: 38px; border-radius: 12px;
  background: linear-gradient(135deg, #34d399, var(--accent));
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 18px; color: #fff; flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(16,185,129,0.45);
}
.brand-sub {
  margin: 0; font-size: 9.5px; font-weight: 800;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--sidebar-text); opacity: 0.6;
}
.brand-lockup h1 {
  margin: 2px 0 0; font-size: 15px; font-weight: 800;
  color: #fff; letter-spacing: -0.025em;
}
.side-nav {
  display: flex; flex-direction: column;
  gap: 2px; padding: 16px 10px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  min-height: 44px; border: 1px solid transparent;
  border-radius: var(--radius-sm); background: transparent;
  color: var(--sidebar-text); text-align: left;
  font-size: 14px; font-weight: 600; padding: 0 12px;
  transition: all 0.15s ease; box-shadow: none;
}
.nav-item:hover {
  background: var(--sidebar-hover); color: rgba(255,255,255,0.9);
  border-color: transparent; box-shadow: none;
}
.nav-item.active {
  background: rgba(16,185,129,0.18);
  border-color: rgba(16,185,129,0.45);
  color: #fff;
}
.nav-item .nav-icon { font-size: 17px; flex-shrink: 0; }
.nav-badge {
  margin-left: auto; min-width: 20px; height: 19px;
  border-radius: 999px; background: var(--accent); color: #fff;
  font-size: 10px; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0 5px; flex-shrink: 0;
}
.nav-badge-watch { background: var(--warning); }
.sidebar-footer {
  padding: 12px 10px; border-top: 1px solid var(--sidebar-border);
  display: flex; flex-direction: column; gap: 6px;
}
.service-status {
  display: flex; align-items: center; justify-content: center;
  min-height: 28px; border-radius: var(--radius-xs); padding: 0 10px;
  background: rgba(255,255,255,0.06); color: var(--sidebar-text);
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.03em;
}
.sidebar-footer button {
  background: rgba(255,255,255,0.07); border-color: rgba(255,255,255,0.10);
  color: var(--sidebar-text); min-height: 34px; font-size: 12px; box-shadow: none;
}
.sidebar-footer button:hover {
  background: rgba(255,255,255,0.13); color: #fff;
  border-color: transparent; box-shadow: none;
}

/* ══════════════════════════════════════════════════════════════════
   MAIN PANEL
   ══════════════════════════════════════════════════════════════════ */
.main-panel { min-width: 0; display: flex; flex-direction: column; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; min-height: 66px; padding: 12px 24px;
  background: rgba(255,255,255,0.95); backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10;
}
.topbar h2 {
  margin: 0; font-size: 21px; font-weight: 800;
  letter-spacing: -0.03em; color: var(--text);
}
.topbar-actions { display: flex; gap: 8px; align-items: center; }

.view { display: none; flex-direction: column; gap: 16px; padding: 20px 24px; }
.view.active { display: flex; }

/* ══════════════════════════════════════════════════════════════════
   METRICS BAR
   ══════════════════════════════════════════════════════════════════ */
.metrics-bar {
  display: flex; gap: 10px; overflow-x: auto;
  padding-bottom: 2px; scrollbar-width: none;
}
.metrics-bar::-webkit-scrollbar { display: none; }
.summary-tile {
  flex: 0 0 auto; min-width: 116px;
  border: 1.5px solid var(--line); border-radius: var(--radius-md);
  background: var(--surface); padding: 12px 16px;
  box-shadow: var(--shadow-xs);
  display: flex; flex-direction: column; gap: 5px;
  transition: box-shadow 0.14s, transform 0.14s;
}
.summary-tile:hover { box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.tile-top { display: flex; align-items: center; gap: 5px; }
.tile-icon { font-size: 14px; line-height: 1; }
.tile-label {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--muted); white-space: nowrap;
}
.tile-value {
  font-size: 22px; font-weight: 800; letter-spacing: -0.05em;
  color: var(--text); font-variant-numeric: tabular-nums;
}
.tile-buy   { border-left: 3px solid var(--success); }
.tile-buy   .tile-value { color: var(--success); }
.tile-fast  { border-left: 3px solid var(--blue); }
.tile-fast  .tile-value { color: var(--blue); }
.tile-profit{ border-left: 3px solid var(--accent); }
.tile-profit.tile-value { color: var(--accent); }
.tile-neg   { border-left: 3px solid var(--warning); }
.tile-neg   .tile-value { color: #854d0e; }
.tile-watch { border-left: 3px solid var(--blue); }
.tile-watch .tile-value { color: var(--blue); }
.tile-safe  { border-left: 3px solid #7ab3c5; }
.tile-tcg   { border-left: 3px solid var(--violet); }
.tile-tcg   .tile-value { color: var(--violet); }
.tile-error { border-left: 3px solid var(--danger); }
.tile-error .tile-value { color: var(--danger); }
.tile-second{ border-left: 3px solid var(--warning); }
.tile-second.tile-value { color: var(--warning); }
.tile-new   { border-left: 3px solid var(--blue); }
.tile-new   .tile-value { color: var(--blue); }

/* ══════════════════════════════════════════════════════════════════
   SMART TABS & FILTERS
   ══════════════════════════════════════════════════════════════════ */
.smart-tabs {
  display: flex; gap: 6px; overflow-x: auto;
  padding-bottom: 8px; scrollbar-width: none;
}
.smart-tabs::-webkit-scrollbar { display: none; }
.smart-tab {
  flex: 0 0 auto; min-height: 34px; padding: 0 16px;
  border-radius: 999px; background: var(--surface);
  border: 1.5px solid var(--line-strong);
  color: var(--muted-strong); font-size: 13px; font-weight: 600;
  white-space: nowrap; transition: all 0.15s;
}
.smart-tab:hover { border-color: var(--accent); color: var(--accent-strong); background: var(--accent-soft); box-shadow: none; }
.smart-tab.active { background: var(--accent); border-color: var(--accent-strong); color: #fff; font-weight: 700; box-shadow: 0 2px 8px rgba(16,185,129,0.28); }
.smart-tab.buy-now-tab { border-color: var(--accent); color: var(--accent); font-weight: 700; }
.smart-tab.buy-now-tab.active { background: var(--accent); color: #fff; }
.smart-tab.negotiate-tab { border-color: #fde047; color: #713f12; }
.smart-tab.negotiate-tab.active { background: var(--warning); color: #fff; border-color: #d97706; }
.smart-tab.watch-tab { border-color: #bfdbfe; color: var(--blue); }
.smart-tab.watch-tab.active { background: var(--blue); color: #fff; border-color: #2563eb; }
.smart-tab.tcg-tab { border-color: #ddd6fe; color: var(--violet); }
.smart-tab.tcg-tab.active { background: var(--violet); color: #fff; border-color: #7c3aed; }
.smart-tab.price-error-tab { border-color: #fca5a5; color: var(--danger); }
.smart-tab.price-error-tab.active { background: var(--danger); color: #fff; border-color: #dc2626; }
.smart-tab.secondhand-tab { border-color: #fde047; color: var(--warning); }
.smart-tab.secondhand-tab.active { background: var(--warning); color: #fff; }
.smart-tab.nuevo-tab { border-color: #bfdbfe; color: var(--blue); }
.smart-tab.nuevo-tab.active { background: var(--blue); color: #fff; }

.filters {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(138px, 1fr));
  gap: 10px; padding: 16px;
  background: var(--surface); border-radius: var(--radius-md);
  border: 1.5px solid var(--line); box-shadow: var(--shadow-xs);
}
.filters label:first-child { grid-column: span 2; }

/* ══════════════════════════════════════════════════════════════════
   CONTENT GRID & PANELS
   ══════════════════════════════════════════════════════════════════ */
.content-grid { display: grid; grid-template-columns: minmax(0,1fr) 390px; gap: 16px; }
.content-grid-full { display: flex; flex-direction: column; gap: 16px; }

.workspace, .detail, .manual-form, .settings-panel, .integration-card {
  min-width: 0; border: 1.5px solid var(--line);
  border-radius: var(--radius-md); background: var(--surface);
  box-shadow: var(--shadow-xs);
}

/* ══════════════════════════════════════════════════════════════════
   TABLE
   ══════════════════════════════════════════════════════════════════ */
.table-wrap {
  overflow: auto; max-height: calc(100vh - 290px);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
}
table { width: 100%; min-width: 1100px; border-collapse: collapse; }
th, td {
  border-bottom: 1px solid var(--line); padding: 10px 12px;
  text-align: left; vertical-align: middle; white-space: nowrap;
}
th {
  position: sticky; top: 0; z-index: 2;
  background: var(--surface-strong); color: var(--muted-strong);
  font-size: 11px; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.05em; padding: 9px 12px;
}
th:first-child { padding-left: 16px; }
tbody tr { height: 60px; transition: background 0.1s; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--surface-soft); }
tbody tr.selected { background: #f0fdf4; box-shadow: inset 3px 0 0 var(--accent); }
td:first-child { padding-left: 16px; }

/* ── Product cell ─────────────────────────────────────────────── */
.product-cell {
  display: grid; grid-template-columns: 48px minmax(200px,1fr);
  align-items: center; gap: 12px; min-width: 260px;
}
.product-cell-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.product-cell-meta { display: flex; gap: 4px; flex-wrap: wrap; }
.row-price-chain { font-size: 11.5px; font-weight: 700; color: var(--muted-strong); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chain-buy   { color: var(--muted); }
.chain-ship  { color: var(--muted); font-weight: 600; }
.chain-arrow { color: var(--muted); }
.chain-sell  { color: var(--text); font-weight: 800; }
.chain-vel   { display: inline-flex; align-items: center; margin-left: 5px; font-size: 10.5px; padding: 1px 5px; border-radius: 8px; background: var(--surface-strong); border: 1px solid var(--line); }
.thumb {
  width: 48px; height: 48px; border-radius: var(--radius-sm);
  object-fit: cover; background: var(--surface-strong); border: 1px solid var(--line);
}
.product-title { font-size: 13.5px; font-weight: 600; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── Row badges ──────────────────────────────────────────────── */
.row-cat-badge, .row-category-badge {
  display: inline-flex; align-items: center; padding: 2px 8px;
  border-radius: 6px; font-size: 11px; font-weight: 700;
  border: 1px solid var(--line); background: var(--surface-strong);
  white-space: nowrap; max-width: 160px; overflow: hidden; text-overflow: ellipsis;
}
.price-doubtful-badge { font-size: 10px; background: var(--warning-soft); color: var(--warning); border: 1px solid #fde047; border-radius: 4px; padding: 1px 5px; margin-left: 4px; }

/* ── Source badges ───────────────────────────────────────────── */
.row-source-badge {
  display: inline-flex; align-items: center; padding: 2px 7px;
  border-radius: 4px; font-size: 10px; font-weight: 700;
  letter-spacing: .02em; text-transform: uppercase; white-space: nowrap; border: 1px solid transparent;
}
.src-ebay     { background: #fff7ed; color: #9a3412; border-color: #fdba74; }
.src-wallapop { background: #f0fdf4; color: #166534; border-color: #86efac; }
.src-vinted   { background: #eff6ff; color: #1e40af; border-color: #93c5fd; }
.src-amazon   { background: #fefce8; color: #713f12; border-color: #fde047; }
.src-cardmarket{ background: #f5f3ff; color: #5b21b6; border-color: #c4b5fd; }
.src-telegram { background: #ecfeff; color: #0e7490; border-color: #67e8f9; }

/* ── Verdict pills ───────────────────────────────────────────── */
.status-label, .recommendation-label, .source-pill {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 24px; border-radius: 999px; padding: 2px 10px;
  font-size: 11.5px; font-weight: 800; white-space: nowrap;
  border: 1px solid transparent; background: var(--surface-strong); color: var(--muted-strong);
}
.recommendation-label::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: currentColor; flex-shrink: 0;
}
.recommendation-label.buy, .source-pill.ready {
  background: var(--buy-bg); color: var(--buy-text); border-color: var(--buy-border);
}
.recommendation-label.negotiate { background: var(--rev-bg); color: var(--rev-text); border-color: var(--rev-border); }
.recommendation-label.watch { background: var(--blue-soft); color: #1e40af; border-color: #93c5fd; }
.recommendation-label.review { background: #fff7ed; color: #9a3412; border-color: #fdba74; }
.recommendation-label.reject { background: var(--rej-bg); color: var(--rej-text); border-color: var(--rej-border); }

.category-badge, .category-badge-lg {
  display: inline-flex; align-items: center; padding: 2px 10px;
  border-radius: 999px; background: var(--accent); color: #fff;
  font-size: 11px; font-weight: 700; white-space: nowrap;
}

/* ── Profit cells ────────────────────────────────────────────── */
.profit-positive { color: #166534; font-weight: 700; }
.profit-neutral  { color: #92400e; font-weight: 600; }
.profit-negative { color: var(--danger); font-weight: 700; }
.profit-cell { font-weight: 700; font-variant-numeric: tabular-nums; }
.profit-great { color: #166534; background: #dcfce7; border-radius: 6px; padding: 2px 8px; }
.profit-good  { color: #15803d; font-weight: 700; }
.profit-ok    { color: #92400e; font-weight: 600; }
.profit-low   { color: var(--muted); font-weight: 500; }
.profit-good  { color: var(--success); font-weight: 700; }

/* ── Row actions ─────────────────────────────────────────────── */
.row-actions { display: flex; gap: 5px; }
.row-actions button {
  width: 30px; height: 30px; min-height: 30px; padding: 0;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 14px; background: transparent; border: 1px solid transparent; box-shadow: none;
}
.row-actions button:hover { background: var(--surface-strong); border-color: var(--line-strong); box-shadow: none; }

/* ── Empty state ─────────────────────────────────────────────── */
.empty {
  display: none; padding: 48px 24px; text-align: center;
  color: var(--muted); font-size: 14.5px;
}

/* ══════════════════════════════════════════════════════════════════
   DETAIL PANEL
   ══════════════════════════════════════════════════════════════════ */
.detail {
  align-self: start; padding: 18px;
  min-height: calc(100vh - 160px);
  position: sticky; top: 70px;
  overflow-y: auto; max-height: calc(100vh - 80px);
}
.detail-empty { color: var(--muted); font-size: 14px; padding: 12px 0; }
.detail-inner { display: flex; flex-direction: column; gap: 12px; }

.detail-img {
  width: 100%; max-height: 240px; object-fit: contain;
  border-radius: var(--radius-md); background: var(--surface-strong);
  border: 1.5px solid var(--line); cursor: zoom-in;
}
.detail-header { display: grid; gap: 10px; }
.detail-title { margin: 0; font-size: 16px; font-weight: 800; line-height: 1.3; }
.detail-badges { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.confidence-badge, .deal-score-badge {
  display: inline-flex; align-items: center;
  padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 700;
  background: var(--surface-strong); border: 1px solid var(--line); color: var(--muted-strong);
}
.detail-reason { margin: 0; font-size: 13px; color: var(--muted-strong); line-height: 1.5; font-style: italic; }
.detail-section {
  border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface-soft); padding: 14px;
  display: flex; flex-direction: column; gap: 10px;
}
.detail-section h4 {
  margin: 0; font-size: 11px; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.07em; color: var(--muted-strong);
}
.detail-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.detail-kv { display: flex; flex-direction: column; gap: 2px; }
.detail-kv span { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; color: var(--muted); }
.detail-kv strong { font-size: 14px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.detail-plat-row {
  display: grid; grid-template-columns: 95px 1fr auto;
  align-items: center; gap: 8px; font-size: 13px;
  color: var(--muted-strong); padding: 4px 0;
  border-bottom: 1px solid var(--line);
}
.detail-plat-row:last-child { border-bottom: none; }
.detail-actions {
  display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin: 4px 0;
}
.detail-actions button { min-height: 38px; font-size: 13px; }
.warnings-section { background: var(--warning-soft); border-color: #fde047; }
.warnings-section p { margin: 0; font-size: 13px; color: #713f12; font-weight: 600; }
.analysis-text { margin: 0; font-size: 13px; color: var(--muted-strong); line-height: 1.6; }

.listing-section summary { cursor: pointer; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted-strong); list-style: none; }
.listing-section summary::-webkit-details-marker { display: none; }
.listing-content { margin-top: 10px; font-size: 13px; color: var(--muted-strong); line-height: 1.6; }
.listing-content p { margin: 0 0 8px; }

/* ── Negotiate section ───────────────────────────────────────── */
.negotiate-section { background: #fefce8; border-color: #fde047; }
.negotiate-section h4 { color: #713f12; }
.negotiate-msg-box { display: flex; flex-direction: column; gap: 5px; margin-top: 4px; }
.negotiate-msg {
  font-size: 13px; line-height: 1.6; color: var(--text);
  background: #fff; border: 1.5px solid #fde047; border-radius: var(--radius-xs);
  padding: 12px; white-space: pre-wrap; cursor: text; user-select: all;
}

/* ── Checklist ───────────────────────────────────────────────── */
.checklist { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--muted-strong); line-height: 1.55; }
.checklist li { margin: 0; }

/* ══════════════════════════════════════════════════════════════════
   MODALS & DIALOGS
   ══════════════════════════════════════════════════════════════════ */
.action-modal {
  border: none; border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); padding: 28px 28px 22px;
  width: 100%; max-width: 400px; background: var(--surface);
}
.action-modal::backdrop { background: rgba(15,23,42,0.55); backdrop-filter: blur(6px); }
.action-modal h3 { margin: 0 0 20px; font-size: 17px; font-weight: 800; letter-spacing: -0.025em; }
.modal-fields { display: flex; flex-direction: column; gap: 14px; margin-bottom: 22px; }
.modal-fields label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 700; color: var(--muted-strong); }
.modal-fields input { min-height: 40px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; }

.image-modal { position: fixed; inset: 0; z-index: 300; display: grid; grid-template-rows: auto minmax(0,1fr); gap: 12px; padding: 16px; background: rgba(10,20,15,0.92); }
.image-modal.hidden { display: none; }
.image-modal button { justify-self: end; border-color: rgba(255,255,255,0.3); color: #fff; background: rgba(255,255,255,0.12); }
.image-modal img { align-self: center; justify-self: center; max-width: 96vw; max-height: 88vh; border-radius: var(--radius-md); }

.auth-overlay { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; background: rgba(15,23,42,0.92); padding: 20px; }
.auth-overlay.hidden { display: none; }

/* ── Listing Kit Modal ────────────────────────────────────────────────────── */
.lk-overlay { position: fixed; inset: 0; z-index: 350; display: grid; place-items: center; background: rgba(15,23,42,0.72); backdrop-filter: blur(8px); padding: 16px; }
.lk-overlay.hidden { display: none; }
.lk-dialog { background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); width: 100%; max-width: 600px; max-height: 90vh; display: flex; flex-direction: column; overflow: hidden; }
.lk-header { padding: 20px 22px 0; display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; }
.lk-header h3 { margin: 0; font-size: 17px; font-weight: 800; letter-spacing: -0.025em; }
.lk-header-sub { font-size: 12px; color: var(--muted); font-weight: 500; margin-top: 2px; }
.lk-close { background: none; border: none; font-size: 22px; color: var(--muted); cursor: pointer; padding: 0 4px; line-height: 1; }
.lk-close:hover { color: var(--text); }
.lk-tabs { display: flex; gap: 4px; padding: 16px 22px 0; flex-shrink: 0; border-bottom: 1px solid var(--border); }
.lk-tab { border: none; background: none; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; padding: 8px 14px; border-radius: 8px 8px 0 0; transition: all .15s; }
.lk-tab:hover { color: var(--text); background: var(--bg); }
.lk-tab.active { color: var(--accent); background: var(--bg); border-bottom: 2px solid var(--accent); }
.lk-body { overflow-y: auto; padding: 18px 22px 22px; flex: 1; }
.lk-panel { display: none; flex-direction: column; gap: 16px; }
.lk-panel.active { display: flex; }
.lk-field { display: flex; flex-direction: column; gap: 6px; }
.lk-field > label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted-strong); }
.lk-copy-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: start; }
.lk-value { font-size: 13px; line-height: 1.5; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 12px; color: var(--text); min-height: 38px; word-break: break-word; }
.lk-textarea { font-size: 12px; font-family: var(--font-mono, monospace); line-height: 1.5; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 12px; color: var(--text); width: 100%; resize: vertical; min-height: 110px; }
.lk-price-row { display: flex; gap: 16px; flex-wrap: wrap; }
.lk-price-badge { font-size: 20px; font-weight: 800; color: var(--accent); letter-spacing: -0.04em; }
.lk-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.lk-tag { font-size: 11px; background: var(--bg); border: 1px solid var(--border); border-radius: 20px; padding: 3px 10px; color: var(--muted-strong); }
.lk-copy-btn { font-size: 12px; font-weight: 600; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 6px 12px; cursor: pointer; white-space: nowrap; color: var(--muted-strong); transition: all .15s; flex-shrink: 0; }
.lk-copy-btn:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.lk-copy-btn.copied { background: #22c55e; color: #fff; border-color: #22c55e; }
.lk-photo-tip { font-size: 13px; color: var(--muted-strong); background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 14px; margin: 0 0 8px; line-height: 1.5; }
.lk-photo-list { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 10px; }
.lk-photo-item { font-size: 13px; line-height: 1.5; color: var(--text); padding: 8px 12px 8px 4px; border-bottom: 1px solid var(--border); }
.lk-photo-item:last-child { border-bottom: none; }
.lk-photo-num { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 11px; font-weight: 800; margin-right: 8px; flex-shrink: 0; }
.lk-selling-points { display: flex; flex-direction: column; gap: 8px; }
.lk-sp-item { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; color: var(--text); }
.lk-sp-item::before { content: "✓"; color: #22c55e; font-weight: 800; flex-shrink: 0; margin-top: 1px; }
.auth-card { display: grid; gap: 16px; width: min(420px,100%); border: 1px solid rgba(255,255,255,0.12); border-radius: var(--radius-lg); background: var(--surface); padding: 32px; box-shadow: var(--shadow-lg); }
.auth-card h2, .auth-card p { margin: 0; }
.auth-card p { color: var(--muted); font-size: 14px; }
.app-mark.auth-mark { margin: 0 auto; width: 52px; height: 52px; font-size: 24px; }

/* More menu */
.more-menu-wrap { position: relative; }
.more-menu { position: absolute; top: calc(100% + 6px); right: 0; background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius-md); box-shadow: var(--shadow); min-width: 200px; z-index: 200; padding: 6px; display: flex; flex-direction: column; gap: 2px; }
.more-menu[hidden] { display: none; }
.more-menu button { width: 100%; text-align: left; border-color: transparent; background: transparent; box-shadow: none; border-radius: var(--radius-xs); font-size: 13.5px; }
.more-menu button:hover { background: var(--surface-strong); border-color: var(--line); color: var(--text); box-shadow: none; }

/* ══════════════════════════════════════════════════════════════════
   MARKET SEARCH
   ══════════════════════════════════════════════════════════════════ */
.market-results { display: grid; gap: 10px; margin-top: 12px; }
.market-item { display: grid; grid-template-columns: 56px 1fr auto; align-items: center; gap: 12px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-soft); padding: 10px 14px; transition: border-color 0.13s, box-shadow 0.13s; }
.market-item:hover { border-color: var(--accent); box-shadow: var(--shadow-xs); }
.market-item img { width: 56px; height: 56px; object-fit: cover; border-radius: var(--radius-xs); background: var(--surface-strong); }
.market-item-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.market-item strong { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.market-item span { color: var(--muted); font-size: 12.5px; font-weight: 700; }
.market-item small { color: var(--muted); font-size: 11.5px; }
.market-item a { color: var(--accent); font-weight: 700; text-decoration: none; white-space: nowrap; padding: 5px 12px; border: 1.5px solid var(--line); border-radius: var(--radius-xs); background: var(--surface); font-size: 12.5px; transition: all 0.12s; }
.market-item a:hover { border-color: var(--accent); background: var(--accent-soft); }

/* ══════════════════════════════════════════════════════════════════
   MANUAL FORM & SETTINGS
   ══════════════════════════════════════════════════════════════════ */
.manual-form { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; max-width: 1120px; padding: 20px; }
.wide { grid-column: 1 / -1; }
.integrations-layout { display: grid; grid-template-columns: 410px minmax(0,1fr); gap: 16px; }
.settings-panel { align-self: start; padding: 20px; }
.settings-form { display: grid; gap: 12px; }
.settings-form.two-col { grid-template-columns: repeat(2,minmax(0,1fr)); }
.public-box { display: grid; gap: 10px; margin: 10px 0 18px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-soft); padding: 14px; }
.public-box a { color: var(--blue); font-weight: 800; text-decoration: none; word-break: break-all; }
.integration-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; align-content: start; }
.integration-card { position: relative; display: flex; flex-direction: column; gap: 12px; border: 1.5px solid var(--line); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-xs); padding: 16px; }
.integration-card.ready { border-color: rgba(22,163,74,0.35); }
.integration-card.partial { border-color: rgba(245,158,11,0.35); }
.integration-card-header { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.integration-provider { display: block; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; }
.integration-card h3 { margin: 3px 0 0; font-size: 15.5px; font-weight: 800; line-height: 1.2; }
.integration-card p { margin: 0; color: var(--muted-strong); line-height: 1.5; font-size: 13px; }
.integration-card a { color: var(--blue); font-weight: 700; text-decoration: none; }
.integration-status { display: inline-flex; align-items: center; min-height: 24px; border-radius: 999px; padding: 2px 10px; font-size: 11.5px; font-weight: 800; white-space: nowrap; }
.integration-status.ready { color: var(--buy-text); background: var(--buy-bg); border: 1px solid var(--buy-border); }
.integration-status.partial { color: var(--rev-text); background: var(--rev-bg); border: 1px solid var(--rev-border); }
.integration-description { margin: 0; color: var(--muted-strong); line-height: 1.5; font-size: 13px; }
.integration-footer { display: flex; justify-content: space-between; gap: 10px; align-items: center; margin-top: auto; }
.integration-hint { color: var(--muted); font-size: 12px; text-align: right; }
.integration-meta { display: flex; flex-wrap: wrap; gap: 6px; }

.search-source-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.search-source-tab { min-height: 32px; padding: 0 14px; font-size: 13px; font-weight: 700; border-radius: var(--radius-xs); border: 1.5px solid var(--line-strong); background: var(--surface-soft); color: var(--muted-strong); cursor: pointer; transition: all 0.13s; }
.search-source-tab:hover { border-color: var(--accent); color: var(--accent); box-shadow: none; }
.search-source-tab.active { border-color: var(--accent); background: var(--accent); color: #fff; box-shadow: none; }

/* ══════════════════════════════════════════════════════════════════
   ANALYTICS / STATS
   ══════════════════════════════════════════════════════════════════ */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(160px,1fr)); gap: 12px; margin-top: 14px; }
.stat-card { background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius-sm); padding: 16px; display: flex; flex-direction: column; gap: 5px; box-shadow: var(--shadow-xs); }
.stat-card.loading, .stat-card.error { grid-column: 1/-1; color: var(--muted); font-size: 14px; }
.stat-label { font-size: 11.5px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.stat-value { font-size: 1.5rem; font-weight: 800; color: var(--text); line-height: 1.1; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.stat-card.positive .stat-value { color: var(--success); }
.stat-card.negative .stat-value { color: var(--danger); }
.hint { font-size: 13px; color: var(--muted); margin: 0 0 6px; }

/* ══════════════════════════════════════════════════════════════════
   TOASTS
   ══════════════════════════════════════════════════════════════════ */
.toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { min-width: 260px; max-width: 400px; padding: 13px 17px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 600; line-height: 1.4; box-shadow: var(--shadow-lg); pointer-events: auto; opacity: 0; transform: translateY(12px) scale(0.97); transition: all 0.24s ease; border: 1.5px solid var(--line); background: var(--surface); color: var(--text); }
.toast.visible { opacity: 1; transform: translateY(0) scale(1); }
.toast-success { background: var(--buy-bg); color: var(--buy-text); border-color: var(--buy-border); }
.toast-error { background: var(--rej-bg); color: var(--rej-text); border-color: var(--rej-border); }
.toast-info { background: var(--blue-soft); color: #1e40af; border-color: #bfdbfe; }
.toast-warning { background: var(--warning-soft); color: #713f12; border-color: #fde047; }

/* ══════════════════════════════════════════════════════════════════
   SECTION HEADER
   ══════════════════════════════════════════════════════════════════ */
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; padding: 4px 0;
}
.section-description { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.55; flex: 1; }

/* ══════════════════════════════════════════════════════════════════
   FLIP DECISION
   ══════════════════════════════════════════════════════════════════ */
.flip-result-panel { margin-top: 14px; }
.flip-card { border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-soft); padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.flip-header { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.flip-confidence { font-size: 12.5px; color: var(--muted-strong); }
.flip-metrics { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; }
.flip-metrics div { display: flex; flex-direction: column; gap: 2px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-xs); padding: 8px 10px; }
.flip-metrics span { font-size: 11px; color: var(--muted); font-weight: 700; }
.flip-metrics strong { font-size: 14px; font-weight: 800; letter-spacing: -0.025em; }
.flip-reason { margin: 0; font-size: 13px; color: var(--muted-strong); line-height: 1.55; border-left: 3px solid var(--accent); padding-left: 12px; }
.flip-checklist { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--text); }
.flip-warnings { display: flex; flex-direction: column; gap: 5px; }
.flip-warnings p { margin: 0; font-size: 13px; color: var(--warning); font-weight: 700; }
.flip-negotiate { font-size: 13px; font-weight: 700; color: #713f12; background: var(--warning-soft); padding: 6px 12px; border-radius: var(--radius-xs); border: 1px solid #fde047; }
.status-label { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; background: var(--surface-strong); color: var(--muted-strong); border: 1px solid var(--line); white-space: nowrap; }

/* ══════════════════════════════════════════════════════════════════
   AI PANEL & LISTING PANEL
   ══════════════════════════════════════════════════════════════════ */
.ai-panel, .listing-panel, .checks-panel { display: grid; gap: 10px; margin: 10px 0; border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-soft); padding: 14px; }
.ai-panel h4, .listing-panel h4, .checks-panel h4 { margin: 0; font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted-strong); }
.score-row { display: grid; grid-template-columns: 115px 1fr 40px; align-items: center; gap: 8px; color: var(--muted-strong); font-size: 12px; font-weight: 600; }
.score-bar { height: 7px; border-radius: 999px; background: var(--line); overflow: hidden; }
.score-bar > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #34d399, var(--accent)); transition: width 0.4s ease; }
.score-bar.risk > span { background: linear-gradient(90deg, var(--warning), var(--danger)); }
.reason { margin: 10px 0; padding: 12px 15px; border-left: 3px solid var(--accent); border-radius: 0 var(--radius-xs) var(--radius-xs) 0; background: #f0fdf4; color: var(--muted-strong); font-size: 13px; line-height: 1.55; }
.checks-list { margin: 0; padding-left: 18px; color: var(--muted-strong); font-size: 13px; line-height: 1.55; }
.checks-list li { margin: 5px 0; }
.listing-panel-header { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.listing-panel-header h4 { flex: 1; margin: 0; }
.listing-section-title { font-size: 11px; font-weight: 800; color: var(--muted-strong); text-transform: uppercase; letter-spacing: 0.07em; margin-bottom: 10px; }
.platform-prices-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.platform-prices-table th { text-align: left; font-size: 10.5px; color: var(--muted); font-weight: 700; padding: 3px 6px 3px 0; border-bottom: 1px solid var(--line); text-transform: uppercase; letter-spacing: 0.04em; background: transparent; position: static; }
.platform-prices-table td { padding: 6px 6px 6px 0; border-bottom: 1px solid var(--line); }
.platform-prices-table tr:last-child td { border-bottom: none; }
.wallapop-hint { font-size: 12px; color: var(--muted-strong); margin-top: 10px; background: var(--success-soft); padding: 7px 12px; border-radius: var(--radius-xs); line-height: 1.55; }
.desc-tabs { display: flex; gap: 5px; margin-bottom: 12px; flex-wrap: wrap; }
.desc-tab { padding: 4px 14px; font-size: 13px; font-weight: 600; border: 1.5px solid var(--line-strong); border-radius: 999px; background: transparent; color: var(--muted-strong); cursor: pointer; transition: all 0.13s; white-space: nowrap; box-shadow: none; }
.desc-tab:hover { border-color: var(--accent); color: var(--accent); box-shadow: none; }
.desc-tab.active { background: var(--accent); color: #fff; border-color: var(--accent-hover); }
.desc-content { display: none; }
.desc-content.active { display: block; }
.desc-title-row { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.desc-platform-title { flex: 1; font-size: 13px; font-weight: 700; color: var(--text); line-height: 1.4; }
.desc-text { font-family: inherit; font-size: 13px; white-space: pre-wrap; background: var(--surface-strong); border-radius: var(--radius-xs); padding: 10px 12px; margin: 0 0 8px; max-height: 200px; overflow-y: auto; color: var(--text); border: 1px solid var(--line); line-height: 1.55; }
.copy-btn { font-size: 12px; padding: 4px 10px; border: 1.5px solid var(--line-strong); border-radius: var(--radius-xs); background: #fff; color: var(--muted-strong); cursor: pointer; transition: all 0.13s; white-space: nowrap; font-weight: 600; box-shadow: none; }
.copy-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); box-shadow: none; }
.copy-desc-btn { display: block; width: 100%; margin-top: 6px; text-align: center; padding: 6px; }
.photo-list { margin: 0; padding-left: 18px; font-size: 13px; color: var(--muted-strong); line-height: 1.55; }
.listing-hashtags { display: flex; flex-wrap: wrap; gap: 5px; border-top: 1px solid var(--line); padding-top: 10px; margin-top: 10px; }
.hashtag { font-size: 11.5px; padding: 2px 9px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-strong); font-weight: 700; }
.image-thumbs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
.image-thumbs button { flex: 0 0 auto; width: 58px; height: 58px; min-height: 58px; padding: 0; overflow: hidden; border-radius: var(--radius-sm); }
.image-thumbs img { width: 100%; height: 100%; object-fit: cover; }
.external-link { display: inline-block; margin-top: 12px; color: var(--blue); font-weight: 700; text-decoration: none; font-size: 14px; }
.external-link:hover { color: var(--accent-strong); }
.rec-platform { display: flex; align-items: flex-start; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.rec-platform:last-child { border-bottom: none; }
.rec-rank { width: 20px; height: 20px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 10.5px; font-weight: 900; display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-top: 1px; }
.rec-platform strong { font-size: 13px; display: block; line-height: 1.4; }
.rec-reason { font-size: 12px; color: var(--muted); display: block; line-height: 1.4; }
.price-error-badge { display: inline-flex; align-items: center; gap: 3px; background: var(--rej-bg); color: var(--rej-text); border: 1px solid var(--rej-border); border-radius: 4px; padding: 1px 6px; font-size: 10.5px; font-weight: 800; }

/* ══════════════════════════════════════════════════════════════════
   INVENTARIO & VENTAS
   ══════════════════════════════════════════════════════════════════ */
.inventario-stats, .ventas-stats { display: flex; gap: 20px; flex-wrap: wrap; }
.inv-stat { display: flex; flex-direction: column; gap: 2px; }
.inv-stat span { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.inv-stat strong { font-size: 22px; font-weight: 800; letter-spacing: -0.04em; color: var(--text); font-variant-numeric: tabular-nums; }

.status-badge { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; white-space: nowrap; border: 1px solid var(--line); background: var(--surface-strong); color: var(--muted-strong); }
.status-purchased   { background: var(--buy-bg);        color: var(--buy-text);   border-color: var(--buy-border); }
.status-received    { background: #dcfce7;               color: #166534;            border-color: #86efac; }
.status-listed      { background: var(--blue-soft);     color: #1e40af;            border-color: #93c5fd; }
.status-reserved    { background: var(--violet-soft);   color: var(--violet);      border-color: #ddd6fe; }
.status-problem     { background: var(--danger-soft);   color: var(--danger);      border-color: var(--rej-border); }
.status-sold        { background: #f0fdf4;               color: #166534;            border-color: #86efac; }
.status-rejected    { background: var(--rej-bg);        color: var(--rej-text);    border-color: var(--rej-border); }
.status-watching    { background: var(--blue-soft);     color: var(--blue);        border-color: #93c5fd; }
.status-negotiating { background: var(--warning-soft);  color: #713f12;            border-color: #fde047; }
.status-detected    { background: var(--surface-strong); color: var(--muted-strong); border-color: var(--line); }
.days-warning { color: var(--danger); font-weight: 700; }

/* ══════════════════════════════════════════════════════════════════
   WEBHOOKS
   ══════════════════════════════════════════════════════════════════ */
.webhook-source-section { display: grid; gap: 8px; }
.webhook-source-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
.webhook-source-grid label { display: flex; flex-direction: column; gap: 3px; font-size: 12.5px; font-weight: 600; color: var(--text); }
.webhook-source-grid label input { font-size: 12px; padding: 5px 9px; border-radius: var(--radius-xs); min-height: 34px; }
.webhook-per-cat { border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-soft); overflow: hidden; }
.webhook-per-cat > summary { cursor: pointer; padding: 12px 16px; font-size: 14px; font-weight: 700; color: var(--text); list-style: none; display: flex; align-items: center; gap: 7px; user-select: none; }
.webhook-per-cat > summary::-webkit-details-marker { display: none; }
.webhook-per-cat > summary::before { content: "▶"; font-size: 10px; color: var(--muted); transition: transform 0.15s; }
.webhook-per-cat[open] > summary::before { transform: rotate(90deg); }
.webhook-per-cat > summary .hint { font-size: 12px; font-weight: 400; color: var(--muted); }
.webhook-cat-body { padding: 4px 16px 16px; display: grid; gap: 16px; }
.webhook-cat-section { display: grid; gap: 8px; }
.webhook-cat-title { font-size: 11px; font-weight: 800; letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted); padding: 4px 0 3px; border-bottom: 1px solid var(--line); }
.webhook-cat-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.webhook-cat-grid label { display: flex; flex-direction: column; gap: 3px; font-size: 12.5px; font-weight: 600; color: var(--text); }
.webhook-cat-grid label input { font-size: 12px; padding: 5px 9px; border-radius: var(--radius-xs); min-height: 34px; }
.discord-test-channels { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 14px; }
.discord-test-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 8px; margin-top: 10px; }
.discord-test-btn { font-size: 12px; padding: 7px 10px; border-radius: var(--radius-xs); background: var(--surface-soft); border: 1.5px solid var(--line); color: var(--text); cursor: pointer; text-align: center; transition: background 0.13s, border-color 0.13s; box-shadow: none; min-height: auto; }
.discord-test-btn:hover:not(:disabled) { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-strong); }
.discord-test-btn:disabled { opacity: 0.45; cursor: wait; }

/* ══════════════════════════════════════════════════════════════════
   CATEGORY COLOR BADGES
   ══════════════════════════════════════════════════════════════════ */
.cat-pokemon_tcg   { background:#fffce8; color:#713f12; border-color:#fde047; }
.cat-magic_tcg     { background:#f5f3ff; color:#4c1d95; border-color:#c4b5fd; }
.cat-yugioh        { background:#eff6ff; color:#1e40af; border-color:#93c5fd; }
.cat-onepiece_tcg  { background:#fff1f2; color:#9f1239; border-color:#fda4af; }
.cat-cartas_tcg    { background:#fef9c3; color:#713f12; border-color:#fde047; }
.cat-coleccionismo { background:#f5f3ff; color:#5b21b6; border-color:#ddd6fe; }
.cat-dyson         { background:#ecfdf5; color:#065f46; border-color:#6ee7b7; }
.cat-telefonos     { background:#eff6ff; color:#1e3a8a; border-color:#93c5fd; }
.cat-apple         { background:#f8fafc; color:#1e293b; border-color:#cbd5e1; }
.cat-gaming        { background:#f0fdf4; color:#166534; border-color:#86efac; }
.cat-herramientas  { background:#fff7ed; color:#7c2d12; border-color:#fdba74; }
.cat-lego          { background:#fefce8; color:#713f12; border-color:#fde047; }
.cat-audio         { background:#f8fafc; color:#334155; border-color:#cbd5e1; }
.cat-fotografia    { background:#f8fafc; color:#1e293b; border-color:#e2e8f0; }
.cat-perfumes      { background:#fff1f2; color:#881337; border-color:#fda4af; }
.cat-relojes       { background:#fef9c3; color:#5c330c; border-color:#fde047; }
.cat-bolsos        { background:#fdf2f8; color:#831843; border-color:#fbcfe8; }
.cat-zapatillas    { background:#eff6ff; color:#1e3a8a; border-color:#93c5fd; }
.cat-ropa_marca    { background:#fff7ed; color:#7c2d12; border-color:#fdba74; }
.cat-drones        { background:#eff6ff; color:#1e3a8a; border-color:#93c5fd; }
.cat-cafeteras     { background:#fff7ed; color:#7c2d12; border-color:#fdba74; }
.cat-robots        { background:#f0fdf4; color:#14532d; border-color:#86efac; }
.cat-instrumentos  { background:#fff7ed; color:#7c2d12; border-color:#fdba74; }
.cat-hifi          { background:#eff6ff; color:#1e3a8a; border-color:#93c5fd; }

/* ══════════════════════════════════════════════════════════════════
   DASHBOARD (INICIO)
   ══════════════════════════════════════════════════════════════════ */
.dashboard-grid { display: flex; flex-direction: column; gap: 18px; padding: 0; }
.dashboard-loading {
  display: flex; align-items: center; gap: 10px;
  color: var(--muted); font-size: 14px; padding: 32px 0;
}
.dash-spinner {
  width: 18px; height: 18px; border: 2.5px solid var(--line-strong);
  border-top-color: var(--accent); border-radius: 50%; flex-shrink: 0;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Stat cards row ─────────────────────────────────────────────── */
.db-stats {
  display: grid; grid-template-columns: repeat(4,1fr); gap: 12px;
}
.db-stat {
  background: var(--surface); border: 1.5px solid var(--line);
  border-radius: var(--radius-lg); padding: 18px 16px 16px;
  cursor: pointer; transition: transform 0.14s, box-shadow 0.14s;
  box-shadow: var(--shadow-xs); position: relative; overflow: hidden;
}
.db-stat::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px;
}
.db-stat-blue::before  { background: var(--blue); }
.db-stat-green::before { background: var(--success); }
.db-stat-amber::before { background: var(--warning); }
.db-stat-emerald::before { background: var(--accent); }
.db-stat:hover { transform: translateY(-3px); box-shadow: var(--shadow-sm); }
.db-stat-icon { font-size: 22px; line-height: 1; margin-bottom: 8px; }
.db-stat-num {
  font-size: 28px; font-weight: 900; letter-spacing: -0.05em;
  font-variant-numeric: tabular-nums; line-height: 1; margin-bottom: 4px;
}
.db-stat-blue   .db-stat-num { color: var(--blue); }
.db-stat-green  .db-stat-num { color: var(--success); }
.db-stat-amber  .db-stat-num { color: var(--warning); }
.db-stat-emerald .db-stat-num { color: var(--accent); }
.db-stat-label { font-size: 11.5px; font-weight: 600; color: var(--muted); }

/* ── Hero CTA ────────────────────────────────────────────────────── */
.db-hero {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 24px 26px;
  background: linear-gradient(135deg, #0f172a 0%, #1a3a6b 60%, #0f3a2e 100%);
  border-radius: var(--radius-xl); color: #fff; box-shadow: var(--shadow);
}
.db-hero-badge {
  display: inline-flex; align-items: center;
  background: rgba(16,185,129,0.2); border: 1px solid rgba(16,185,129,0.4);
  color: #6ee7b7; font-size: 11px; font-weight: 700;
  letter-spacing: 0.04em; padding: 3px 10px; border-radius: 20px;
  margin-bottom: 8px; width: fit-content;
}
.db-hero-title { font-size: 20px; font-weight: 800; color: #fff; margin: 0 0 6px; }
.db-hero-sub   { font-size: 13px; color: #94a3b8; margin: 0; line-height: 1.5; }
.db-hero-btn {
  flex-shrink: 0; min-height: 48px; padding: 0 24px;
  border-radius: var(--radius-md); font-size: 14px; font-weight: 700;
  white-space: nowrap; box-shadow: 0 4px 16px rgba(16,185,129,0.4);
}

/* ── Section title ───────────────────────────────────────────────── */
.db-section-title {
  display: flex; align-items: center; gap: 10px;
  font-size: 11.5px; font-weight: 700; color: var(--muted-strong);
  text-transform: uppercase; letter-spacing: 0.06em;
}
.db-section-title::after {
  content: ""; flex: 1; height: 1px; background: var(--line);
}
.db-ver-todas {
  margin-left: 4px; min-height: auto; border: none; background: transparent;
  color: var(--accent); font-size: 12px; font-weight: 700;
  padding: 0; box-shadow: none; text-transform: none; letter-spacing: 0;
}
.db-ver-todas:hover { color: var(--accent-strong); background: transparent; box-shadow: none; }

/* ── Pipeline ────────────────────────────────────────────────────── */
.db-pipeline {
  display: flex; align-items: center;
  background: var(--surface); border: 1.5px solid var(--line);
  border-radius: var(--radius-lg); padding: 20px 16px;
  box-shadow: var(--shadow-xs); overflow-x: auto; gap: 0;
}
.db-pipe-step {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  flex: 1; min-width: 72px; cursor: pointer;
  padding: 6px 8px; border-radius: var(--radius-md);
  transition: background 0.13s;
}
.db-pipe-step:hover { background: var(--accent-soft); }
.db-pipe-circle {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800;
  background: var(--surface-strong); border: 2px solid var(--line-strong);
  color: var(--muted); transition: all 0.2s;
}
.db-pipe-step.active .db-pipe-circle {
  background: var(--accent); border-color: var(--accent-hover);
  color: #fff; box-shadow: 0 2px 10px rgba(16,185,129,0.35);
}
.db-pipe-count {
  font-size: 26px; font-weight: 900; color: var(--muted);
  letter-spacing: -0.05em; font-variant-numeric: tabular-nums; line-height: 1;
}
.db-pipe-step.active .db-pipe-count { color: var(--accent); }
.db-pipe-label {
  font-size: 11px; font-weight: 600; color: var(--muted);
  text-align: center; white-space: nowrap;
}
.db-pipe-step.active .db-pipe-label { color: var(--muted-strong); }
.db-pipe-line {
  flex: 1; height: 2px; background: var(--line-strong);
  min-width: 12px; transition: background 0.2s;
}
.db-pipe-line.filled { background: var(--accent); }

/* ── Opportunity cards ───────────────────────────────────────────── */
.db-opps { display: flex; flex-direction: column; gap: 8px; }
.db-opp-card {
  display: grid; grid-template-columns: 54px 1fr;
  align-items: center; gap: 12px; padding: 12px 14px;
  background: var(--surface); border: 1.5px solid var(--line);
  border-radius: var(--radius-md); cursor: pointer;
  transition: border-color 0.14s, box-shadow 0.14s, transform 0.12s;
  box-shadow: var(--shadow-xs);
}
.db-opp-card:hover { border-color: var(--accent); box-shadow: var(--shadow-sm); transform: translateX(3px); }
.db-opp-card.db-opp-buy  { border-left: 3px solid var(--success); }
.db-opp-card.db-opp-watch { border-left: 3px solid var(--blue); }
.db-opp-img {
  width: 54px; height: 54px; border-radius: var(--radius-sm);
  object-fit: cover; background: var(--surface-strong); border: 1px solid var(--line);
  flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 24px;
}
.db-opp-img-ph { display: flex !important; }
.db-opp-body { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.db-opp-title {
  font-size: 13.5px; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.db-opp-tags { display: flex; gap: 5px; flex-wrap: wrap; }
.db-tag {
  display: inline-flex; align-items: center; padding: 2px 7px;
  border-radius: 6px; font-size: 11px; font-weight: 600; white-space: nowrap;
}
.db-tag-src { background: var(--surface-strong); border: 1px solid var(--line); color: var(--muted-strong); }
.db-tag-roi { background: var(--accent-soft); border: 1px solid #a7f3d0; color: var(--accent-strong); }
.db-tag-buy { background: #dcfce7; border: 1px solid #86efac; color: #15803d; }
.vel-fast { background: #fef9c3; border: 1px solid #fde047; color: #854d0e; }
.vel-med  { background: #e0f2fe; border: 1px solid #7dd3fc; color: #075985; }
.vel-slow { background: var(--surface-strong); border: 1px solid var(--line); color: var(--muted); }
.db-opp-right { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; white-space: nowrap; }
.db-opp-profit {
  font-size: 14px; font-weight: 800; color: var(--success);
  font-variant-numeric: tabular-nums;
}
.db-opp-cost  { font-size: 12px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }

/* Deal chain in dashboard cards */
.db-opp-chain { display: flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; flex-wrap: wrap; font-variant-numeric: tabular-nums; }
.db-chain-buy   { color: var(--muted-strong); }
.db-chain-arrow { color: var(--muted); }
.db-chain-sell  { color: var(--text); }
.db-chain-profit.pos { color: #16a34a; font-size: 13px; }
.db-chain-profit.neg { color: var(--danger); font-size: 13px; }
.db-roi-badge { display: inline-flex; align-items: center; font-size: 10.5px; font-weight: 800; padding: 2px 7px; border-radius: 10px; }
.db-roi-excellent { background: #dcfce7; border: 1px solid #86efac; color: #166534; }
.db-roi-good      { background: #fef9c3; border: 1px solid #fde047; color: #854d0e; }
.db-roi-ok        { background: var(--surface-strong); border: 1px solid var(--line); color: var(--muted-strong); }
.db-verdict-tag { font-weight: 800; }
.db-verdict-tag.db-opp-buy  { background: #dcfce7; border: 1px solid #86efac; color: #166534; }
.db-verdict-tag.db-opp-watch { background: #dbeafe; border: 1px solid #93c5fd; color: #1d4ed8; }
.db-tag-platform { background: var(--surface-strong); border: 1px solid var(--line); color: var(--muted); }

/* ── Onboarding ──────────────────────────────────────────────────── */
.db-onboard {
  background: var(--surface); border: 1.5px solid var(--line);
  border-radius: var(--radius-lg); padding: 20px 20px 16px;
  box-shadow: var(--shadow-xs);
}
.db-onboard-title { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 16px; }
.db-onboard-steps { display: flex; flex-direction: column; gap: 12px; }
.db-onboard-step {
  display: grid; grid-template-columns: 28px 1fr; gap: 12px; align-items: flex-start;
}
.db-onboard-step strong { display: block; font-size: 13.5px; font-weight: 700; color: var(--text); }
.db-onboard-step span   { display: block; font-size: 12.5px; color: var(--muted); margin-top: 1px; line-height: 1.4; }
.db-onboard-num {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800;
  background: var(--surface-strong); border: 2px solid var(--line-strong);
  color: var(--muted); flex-shrink: 0;
}
.db-onboard-step.done .db-onboard-num { background: var(--success-soft); border-color: #6ee7b7; color: var(--success); }
.db-onboard-step.current .db-onboard-num { background: var(--accent); border-color: var(--accent-hover); color: #fff; box-shadow: 0 2px 10px rgba(16,185,129,0.35); }
.db-onboard-step.current strong { color: var(--accent-strong); }

/* ── Quick actions ───────────────────────────────────────────────── */
.db-actions {
  display: grid; grid-template-columns: repeat(4,1fr); gap: 10px;
}
.db-action {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 14px 10px; min-height: 72px;
  background: var(--surface); border: 1.5px solid var(--line);
  border-radius: var(--radius-md); cursor: pointer; font-size: 12.5px;
  font-weight: 600; color: var(--muted-strong);
  transition: all 0.15s; box-shadow: var(--shadow-xs);
}
.db-action:hover { border-color: var(--accent); color: var(--accent-strong); background: var(--accent-soft); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.db-action-icon { font-size: 22px; line-height: 1; }

/* ── Error ───────────────────────────────────────────────────────── */
.dash-error {
  padding: 20px; background: var(--danger-soft);
  border: 1.5px solid #fca5a5; border-radius: var(--radius-lg);
  color: var(--danger); font-weight: 600; font-size: 14px; line-height: 1.6;
}
.dash-error small { font-weight: 400; color: var(--muted-strong); display: block; margin-top: 4px; }

/* ── Mobile ──────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .db-stats { grid-template-columns: repeat(2,1fr); }
  .db-actions { grid-template-columns: repeat(4,1fr); }
}

/* ══════════════════════════════════════════════════════════════════
   IMPORT ARBITRAGE
   ══════════════════════════════════════════════════════════════════ */
.import-stats-grid { display: grid; grid-template-columns: repeat(5,1fr); gap: 12px; margin-bottom: 24px; }
.import-stat-card {
  background: var(--surface); border: 1.5px solid var(--line);
  border-radius: var(--radius-md); padding: 16px 14px;
  text-align: center; box-shadow: var(--shadow-xs);
  transition: box-shadow 0.14s, transform 0.14s;
}
.import-stat-card:hover { box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.import-stat-value { font-size: 28px; font-weight: 900; color: var(--accent); letter-spacing: -0.05em; font-variant-numeric: tabular-nums; }
.import-stat-label { font-size: 11.5px; color: var(--muted); margin-top: 5px; font-weight: 600; }

.import-platforms-row { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; margin-bottom: 24px; }
.import-platform-card {
  background: var(--surface); border: 1.5px solid var(--line);
  border-radius: var(--radius-lg); padding: 20px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  box-shadow: var(--shadow-xs); transition: box-shadow 0.14s, transform 0.14s;
}
.import-platform-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.import-platform-card strong { font-size: 15px; font-weight: 800; }
.import-platform-card span { font-size: 12px; color: var(--muted); font-weight: 600; }
.import-platform-logo { font-size: 32px; }
.import-platform-card.ali     { border-color: #ff6a0088; background: linear-gradient(180deg, #fff7f0, #fff); }
.import-platform-card.alibaba { border-color: #f5a62388; background: linear-gradient(180deg, #fffbf0, #fff); }
.import-platform-card.ebay    { border-color: #e5323888; background: linear-gradient(180deg, #fff2f2, #fff); }

.import-opp-card {
  display: flex; gap: 14px; background: var(--surface);
  border: 1.5px solid var(--line); border-radius: var(--radius-md);
  padding: 14px; margin-bottom: 10px;
  box-shadow: var(--shadow-xs); transition: box-shadow 0.15s, border-color 0.15s;
}
.import-opp-card:hover { box-shadow: var(--shadow-sm); border-color: var(--accent); }
.import-opp-img { width: 80px; height: 80px; flex-shrink: 0; border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-strong); display: flex; align-items: center; justify-content: center; border: 1px solid var(--line); }
.import-opp-img img { width: 100%; height: 100%; object-fit: cover; }
.no-img { font-size: 32px; }
.import-opp-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.import-opp-title { font-size: 14px; font-weight: 700; line-height: 1.3; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.import-opp-meta { display: flex; gap: 6px; flex-wrap: wrap; }
.supplier-badge { display: inline-flex; align-items: center; gap: 3px; font-size: 10.5px; font-weight: 700; padding: 2px 8px; border-radius: 10px; background: var(--surface-strong); border: 1px solid var(--line); }
.supplier-badge.supplier-aliexpress { border-color: #ff6a0088; color: #c2410c; }
.supplier-badge.supplier-alibaba    { border-color: #f5a62388; color: #92400e; }
.supplier-badge.supplier-ebay       { border-color: #e5323888; color: #b91c1c; }
.supplier-badge.supplier-wallapop   { border-color: #13c4a188; color: #0f766e; }
.supplier-badge.supplier-dhgate     { border-color: #0ea5e988; color: #0369a1; }
.import-pipeline-badge { font-size: 10.5px; padding: 2px 8px; border-radius: 10px; background: var(--surface-strong); border: 1px solid var(--line); color: var(--muted); font-weight: 600; }

.import-filter-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.import-filter-tab { padding: 6px 16px; border-radius: 20px; font-size: 12.5px; font-weight: 700; background: var(--surface-strong); border: 1.5px solid var(--line); color: var(--muted); cursor: pointer; transition: all 0.14s; }
.import-filter-tab:hover { border-color: var(--accent); color: var(--accent); }
.import-filter-tab.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.verdict-badge { display: inline-flex; align-items: center; font-size: 10px; font-weight: 800; padding: 2px 8px; border-radius: 10px; text-transform: uppercase; letter-spacing: 0.04em; }
.verdict-BUY       { background: #dcfce7; border: 1px solid #86efac; color: #166534; }
.verdict-NEGOTIATE { background: #fef9c3; border: 1px solid #fde047; color: #854d0e; }
.verdict-WATCH     { background: #dbeafe; border: 1px solid #93c5fd; color: #1d4ed8; }
.verdict-REVIEW    { background: var(--surface-strong); border: 1px solid var(--line); color: var(--muted); }
.verdict-REJECT    { background: #fee2e2; border: 1px solid #fca5a5; color: #991b1b; }

.roi-badge { display: inline-flex; align-items: center; font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 10px; }
.roi-excellent { background: #dcfce7; border: 1px solid #86efac; color: #166534; }
.roi-good      { background: #fef9c3; border: 1px solid #fde047; color: #854d0e; }
.roi-ok        { background: var(--surface-strong); border: 1px solid var(--line); color: var(--muted-strong); }
.roi-poor      { background: #fee2e2; border: 1px solid #fca5a5; color: #991b1b; }

.import-opp-header { display: flex; flex-direction: column; gap: 4px; }
.import-opp-badges { display: flex; gap: 5px; flex-wrap: wrap; align-items: center; }
.import-opp-financials { display: flex; flex-direction: column; gap: 4px; }
.import-fin-chain { display: flex; gap: 7px; align-items: center; font-size: 13.5px; font-weight: 700; flex-wrap: wrap; }
.fin-item.buy   { color: var(--muted-strong); }
.fin-item.ship  { color: var(--muted); font-size: 12px; }
.fin-item.resale { color: var(--text); }
.fin-sep        { color: var(--muted); font-size: 12px; }
.fin-profit.pos { color: #16a34a; font-size: 15px; }
.fin-profit.neg { color: var(--danger); font-size: 15px; }
.import-roi-row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.days-badge, .deal-score-badge, .platform-sell-badge { display: inline-flex; align-items: center; font-size: 10.5px; font-weight: 700; padding: 2px 8px; border-radius: 10px; background: var(--surface-strong); border: 1px solid var(--line); color: var(--muted-strong); }
.import-opp-actions { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 5px; }

.import-section { background: linear-gradient(135deg, var(--surface-soft) 0%, #f0fdf4 100%); border: 1.5px solid #a7f3d0; border-radius: var(--radius-md); padding: 16px; }
.import-pipeline { display: flex; align-items: center; gap: 5px; margin-top: 14px; flex-wrap: wrap; }
.pipeline-step { padding: 5px 12px; border-radius: 14px; font-size: 12px; font-weight: 600; background: var(--surface); border: 1.5px solid var(--line); color: var(--muted); }
.pipeline-step.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-strong); }
.pipeline-step.done { background: #dcfce7; border-color: #86efac; color: #166534; }
.pipeline-arrow { color: var(--muted); font-size: 13px; }
.import-tracking { font-size: 13px; color: var(--muted); margin: 5px 0 0; }
.import-tracking a { color: var(--accent); font-weight: 600; }

/* ══════════════════════════════════════════════════════════════════
   AI LISTING PREVIEW
   ══════════════════════════════════════════════════════════════════ */
.ai-listing-section { background: linear-gradient(135deg, #f0fdf4 0%, #fff 100%); border: 1.5px solid #86efac; border-radius: var(--radius-md); padding: 16px; }
.ai-listing-section h4 { margin: 0 0 12px; font-size: 13.5px; font-weight: 700; display: flex; align-items: center; gap: 7px; }
.ai-mode-badge { font-size: 10.5px; font-weight: 700; padding: 2px 8px; border-radius: 10px; background: var(--surface-strong); border: 1px solid var(--line); color: var(--muted); }
.ai-badge-real { background: #dcfce7; border-color: #86efac; color: #166534; }
.ai-platform-card { background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius-sm); padding: 12px; margin-bottom: 10px; }
.ai-platform-header { font-size: 12.5px; font-weight: 700; color: var(--muted-strong); margin-bottom: 8px; }
.ai-copy-row { display: flex; align-items: center; gap: 7px; cursor: pointer; padding: 7px 10px; background: var(--surface-strong); border-radius: var(--radius-xs); border: 1.5px dashed var(--line); transition: background 0.13s, border-color 0.13s; }
.ai-copy-row:hover { background: var(--accent-soft); border-color: var(--accent); }
.ai-copy-text { flex: 1; font-size: 13px; font-weight: 600; line-height: 1.35; }
.copy-hint { font-size: 15px; flex-shrink: 0; opacity: 0.7; }
.ai-keywords { display: flex; flex-wrap: wrap; gap: 5px; margin: 7px 0 0; }
.ai-keywords span { font-size: 10.5px; padding: 2px 7px; background: var(--surface-strong); border-radius: 8px; border: 1px solid var(--line); color: var(--muted); }
.ai-desc-toggle { font-size: 12px; color: var(--accent); cursor: pointer; margin-top: 7px; font-weight: 600; }
.ai-desc-preview { font-size: 12px; color: var(--muted); line-height: 1.55; margin-top: 7px; padding: 10px; background: var(--surface-soft); border-radius: var(--radius-xs); white-space: pre-wrap; word-break: break-word; border: 1px solid var(--line); }
.ai-selling-points { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 5px; }
.ai-selling-points span { font-size: 12px; color: #166534; font-weight: 600; }
.ai-listing-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; padding-top: 12px; border-top: 1.5px solid var(--line); }

/* ══════════════════════════════════════════════════════════════════
   RESPONSIVE — 1180px
   ══════════════════════════════════════════════════════════════════ */
@media (max-width: 1180px) {
  .content-grid, .integrations-layout { grid-template-columns: 1fr; }
  .detail { min-height: auto; position: static; max-height: none; }
  .db-stats { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: sticky; top: 0; z-index: 3; height: auto; }
  .side-nav { flex-direction: row; flex-wrap: wrap; gap: 4px; padding: 8px 10px; }
  .nav-item { width: auto; min-height: 38px; font-size: 13px; }
  .manual-form, .integration-list, .settings-form.two-col { grid-template-columns: 1fr 1fr; }
  .webhook-source-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .discord-test-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 700px) {
  .topbar { flex-direction: column; align-items: flex-start; min-height: auto; padding: 12px 18px; gap: 8px; }
  .view { padding: 12px 16px; gap: 12px; }
  .manual-form, .integration-list, .settings-form.two-col { grid-template-columns: 1fr; }
  .detail-actions { grid-template-columns: repeat(2,1fr); }
  .detail-grid-2 { grid-template-columns: 1fr; }
  .import-stats-grid { grid-template-columns: repeat(2,1fr); }
  .import-platforms-row { grid-template-columns: 1fr; }
  .webhook-source-grid { grid-template-columns: 1fr; }
  .webhook-cat-grid { grid-template-columns: 1fr; }
}

.bottom-nav { display: none; }

/* ══════════════════════════════════════════════════════════════════
   MOBILE ≤ 640px — Full redesign
   ══════════════════════════════════════════════════════════════════ */
@media (max-width: 640px) {
  html, body { height: 100dvh; overflow: hidden; }

  .app-shell {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
    height: 100dvh;
    overflow: hidden;
    min-height: unset;
  }

  .sidebar { display: none; }

  .main-panel {
    display: flex; flex-direction: column;
    height: 100dvh; overflow: hidden;
  }

  /* ── Topbar ────────────────────────────────────────────────────── */
  .topbar {
    flex-shrink: 0; flex-direction: row; align-items: center;
    justify-content: space-between; flex-wrap: nowrap; gap: 8px;
    min-height: 56px; padding: 0 16px;
    background: var(--surface); border-bottom: 1.5px solid var(--line);
    position: sticky; top: 0; z-index: 10;
  }
  .topbar h2 { font-size: 18px; margin: 0; }
  .topbar-actions { gap: 6px; flex-wrap: nowrap; }
  .topbar-actions button { font-size: 12.5px; padding: 6px 12px; min-height: 38px; }

  /* ── Scrollable content ────────────────────────────────────────── */
  .main-panel > section.view {
    flex: 1; min-height: 0;
    overflow-y: scroll; overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding: 14px 12px 84px; gap: 12px;
  }

  /* Kill nested scroll trap */
  .table-wrap { overflow: visible; max-height: none; }
  .workspace table { min-width: 0; }

  /* ── Filters ────────────────────────────────────────────────────── */
  .filters {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 8px; padding: 12px; border-radius: var(--radius-md);
    border: 1.5px solid var(--line);
  }
  .filters label { font-size: 11px; }
  .filters input, .filters select { font-size: 13.5px; padding: 7px 10px; }

  /* ── Smart tabs ─────────────────────────────────────────────────── */
  .smart-tabs { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; padding-bottom: 4px; gap: 5px; }
  .smart-tabs::-webkit-scrollbar { display: none; }
  .smart-tab { white-space: nowrap; flex-shrink: 0; font-size: 13px; padding: 6px 14px; min-height: 36px; }

  /* ── Metrics ────────────────────────────────────────────────────── */
  .metrics-bar { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .metrics-bar::-webkit-scrollbar { display: none; }
  .summary-tile { min-width: 88px; flex-shrink: 0; padding: 10px 12px; }
  .tile-value { font-size: 20px; }
  .tile-label { font-size: 10.5px; }

  /* ── Dashboard mobile ───────────────────────────────────────────── */
  .dashboard-grid { gap: 14px; }
  .db-stats { grid-template-columns: repeat(2,1fr); gap: 8px; }
  .db-stat { padding: 14px 12px 12px; }
  .db-stat-num { font-size: 22px; }
  .db-hero { flex-direction: column; align-items: stretch; gap: 14px; padding: 18px 16px; }
  .db-hero-btn { width: 100%; }
  .db-hero-title { font-size: 17px; }
  .db-pipeline { padding: 14px 10px; }
  .db-pipe-circle { width: 26px; height: 26px; font-size: 11px; }
  .db-pipe-count { font-size: 20px; }
  .db-pipe-label { font-size: 10px; }
  .db-opp-card { grid-template-columns: 44px 1fr; gap: 8px; padding: 10px 12px; }
  .db-opp-img { width: 44px; height: 44px; font-size: 18px; }
  .db-opp-title { font-size: 12.5px; }
  .db-actions { grid-template-columns: repeat(4,1fr); gap: 6px; }
  .db-action { padding: 12px 6px; min-height: 60px; font-size: 11px; }
  .db-action-icon { font-size: 20px; }

  /* ── TABLE → CARDS ──────────────────────────────────────────────── */
  .workspace { border-radius: var(--radius-md); }
  .workspace table { border-collapse: separate; border-spacing: 0; width: 100%; }
  .workspace thead { display: none; }
  .workspace tbody { display: flex; flex-direction: column; gap: 10px; }
  .workspace tbody tr {
    display: flex; flex-direction: column;
    background: var(--surface); border: 1.5px solid var(--line);
    border-radius: var(--radius-md); overflow: hidden;
    box-shadow: var(--shadow-xs); padding: 0; height: auto;
  }
  .workspace tbody tr.selected {
    border-color: var(--accent);
    box-shadow: 0 0 0 2.5px var(--accent-soft);
  }
  /* Hide unused cols */
  .workspace tbody tr td:nth-child(3),
  .workspace tbody tr td:nth-child(5) { display: none; }
  /* Title row */
  .workspace tbody tr td:nth-child(1) { padding: 12px 12px 6px; display: block; width: 100%; }
  /* Verdict */
  .workspace tbody tr td:nth-child(6) { padding: 0 12px 8px; display: flex; justify-content: flex-start; }
  .recommendation-label { font-size: 11.5px; padding: 2px 9px; }
  /* Price row */
  .workspace tbody tr td:nth-child(2),
  .workspace tbody tr td:nth-child(4) { display: inline-flex; align-items: center; padding: 0 12px 10px; font-size: 14px; width: 50%; float: left; font-weight: 600; }
  .workspace tbody tr td:nth-child(2)::before { content: "💳 "; font-size: 12px; }
  .workspace tbody tr td:nth-child(4)::before { content: "💰 "; font-size: 12px; }
  .profit-cell { font-weight: 700; color: var(--success); }
  /* Actions bar */
  .workspace tbody tr td:nth-child(7) { display: block; width: 100%; clear: both; border-top: 1.5px solid var(--line); }
  .row-actions { display: grid; grid-template-columns: repeat(3,1fr); }
  .row-actions button {
    width: 100%; height: 44px; min-height: 44px;
    border-radius: 0; border: none; border-right: 1px solid var(--line);
    font-size: 17px; background: transparent; box-shadow: none;
  }
  .row-actions button:last-child { border-right: none; }
  .row-actions button:active { background: var(--surface-strong); }
  /* Product cell */
  .product-cell { display: flex; gap: 12px; align-items: flex-start; min-width: 0; }
  .thumb { width: 52px; height: 52px; border-radius: var(--radius-sm); flex-shrink: 0; }
  .product-cell-info { min-width: 0; flex: 1; }
  .product-title { font-size: 14px; white-space: normal; }

  /* ── Detail panel: full screen slide-in ────────────────────────── */
  .detail {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    width: 100%; height: 100%; min-height: 0; max-height: none;
    z-index: 100; background: var(--bg);
    overflow-y: scroll; -webkit-overflow-scrolling: touch;
    padding: 16px 14px 84px; transform: translateX(100%);
    transition: transform 0.28s cubic-bezier(0.4,0,0.2,1);
    border-radius: 0; box-sizing: border-box;
  }
  .detail.mobile-open { transform: translateX(0); }
  .detail-back-btn {
    display: flex; align-items: center; gap: 7px;
    background: none; border: none; font-size: 15px; font-weight: 700;
    color: var(--accent); padding: 4px 0 16px; cursor: pointer; box-shadow: none;
  }
  .detail-back-btn:hover { background: none; box-shadow: none; }
  .detail-actions { grid-template-columns: 1fr 1fr; }
  .detail-grid-2 { grid-template-columns: 1fr; }
  .detail-kv strong { font-size: 15px; }

  /* ── Forms ──────────────────────────────────────────────────────── */
  .manual-form, .integration-list, .settings-form.two-col { grid-template-columns: 1fr; }
  .form-actions { flex-wrap: wrap; }
  .form-actions button { flex: 1 1 auto; }
  .section-header { flex-direction: column; gap: 8px; align-items: flex-start; }
  .integrations-layout { grid-template-columns: 1fr; gap: 12px; }

  /* ── Import view ─────────────────────────────────────────────────── */
  .import-stats-grid { grid-template-columns: repeat(2,1fr); gap: 8px; }
  .import-platforms-row { grid-template-columns: 1fr; gap: 10px; }
  .import-opp-actions { flex-wrap: wrap; }
  .import-opp-card { padding: 12px; gap: 10px; }
  .import-opp-img { width: 68px; height: 68px; }
  .import-stat-value { font-size: 22px; }

  /* ── Bottom nav ─────────────────────────────────────────────────── */
  .bottom-nav {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 200;
    background: var(--surface); border-top: 1.5px solid var(--line);
    height: 62px; padding-bottom: env(safe-area-inset-bottom,0px);
    box-shadow: 0 -3px 14px rgba(15,23,42,0.08);
  }
  .bottom-nav button {
    flex: 1; display: flex; flex-direction: column; align-items: center;
    justify-content: center; gap: 3px; background: none; border: none;
    border-radius: 0; font-size: 10.5px; font-weight: 700; color: var(--muted);
    min-height: 62px; padding: 0; box-shadow: none; letter-spacing: 0.01em;
    transition: color 0.15s, background 0.15s;
  }
  .bottom-nav button .bnav-icon { font-size: 22px; line-height: 1; }
  .bottom-nav button.active { color: var(--accent); background: var(--accent-soft); }
  .bottom-nav button:active { background: var(--surface-strong); }

  /* Misc */
  .content-grid { gap: 12px; }
  .discord-test-grid { grid-template-columns: repeat(2,1fr); }
  .webhook-source-grid { grid-template-columns: 1fr; }
  .webhook-cat-grid { grid-template-columns: 1fr; }
  .ai-listing-section { padding: 12px; }
}
