:root {
    --bg: #f4f7fb;
    --surface: #ffffff;
    --surface-2: #f8fafc;
    --surface-3: #eef3f8;
    --text: #172033;
    --muted: #6d7890;
    --border: #dfe6ef;
    --primary: #3167e3;
    --primary-2: #244fb4;
    --primary-soft: #eaf0ff;
    --green: #0b9b6d;
    --green-soft: #e6f7f1;
    --orange: #e58b17;
    --orange-soft: #fff3dd;
    --purple: #7b57d1;
    --purple-soft: #f0ebff;
    --red: #d94e5d;
    --red-soft: #ffebee;
    --shadow: 0 14px 40px rgba(33, 50, 84, 0.08);
    --shadow-sm: 0 7px 20px rgba(33, 50, 84, 0.07);
    --radius: 18px;
    --radius-sm: 11px;
    --sidebar-width: 252px;
}

html[data-theme="dark"] {
    --bg: #0d1320;
    --surface: #151d2c;
    --surface-2: #111827;
    --surface-3: #202a3a;
    --text: #edf2fb;
    --muted: #9aa7bc;
    --border: #2b3649;
    --primary: #6792ff;
    --primary-2: #88a9ff;
    --primary-soft: #202d50;
    --green: #43c99b;
    --green-soft: #173b32;
    --orange: #f3b14f;
    --orange-soft: #3d2f1c;
    --purple: #a78bfa;
    --purple-soft: #30264d;
    --red: #ff7a87;
    --red-soft: #44242b;
    --shadow: 0 16px 42px rgba(0, 0, 0, 0.25);
    --shadow-sm: 0 8px 24px rgba(0, 0, 0, 0.2);
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 14px;
    line-height: 1.5;
}
button, input, select { font: inherit; }
a { color: inherit; }

.app-shell { min-height: 100vh; }
.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 30;
    width: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    padding: 24px 18px 18px;
    background: #111a2c;
    color: #dbe5f6;
    border-right: 1px solid rgba(255,255,255,.06);
}
.brand { display: flex; align-items: center; gap: 12px; padding: 2px 8px 25px; }
.brand-mark {
    width: 42px; height: 42px; display: grid; place-items: center;
    border-radius: 13px; background: linear-gradient(145deg, #4f82ff, #7758d8);
    color: #fff; font-weight: 800; letter-spacing: -.03em;
    box-shadow: 0 10px 24px rgba(65, 105, 225, .3);
}
.brand strong { display: block; color: #fff; font-size: 14px; }
.brand span { display: block; color: #8190aa; font-size: 12px; }
.nav-list { display: flex; flex-direction: column; gap: 5px; }
.nav-link {
    display: flex; align-items: center; gap: 11px; min-height: 43px;
    padding: 10px 12px; color: #9eacc1; text-decoration: none; border-radius: 10px;
    font-weight: 650; transition: .18s ease;
}
.nav-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-link.active { background: linear-gradient(90deg, rgba(80,128,255,.24), rgba(80,128,255,.08)); color: #fff; box-shadow: inset 3px 0 0 #6f97ff; }
.nav-icon { width: 23px; height: 23px; display: grid; place-items: center; font-size: 17px; font-weight: 800; }
.nav-section-label { margin: 20px 12px 6px; color: #5f6f88; font-size: 10px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.sidebar-footer {
    margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 13px;
    border: 1px solid rgba(255,255,255,.08); background: rgba(255,255,255,.035); border-radius: 12px;
}
.sidebar-footer strong, .sidebar-footer span { display: block; }
.sidebar-footer strong { color: #e7edf8; font-size: 12px; }
.sidebar-footer span { color: #7888a1; font-size: 11px; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: #38d99f; box-shadow: 0 0 0 5px rgba(56,217,159,.12); }

.app-main { margin-left: var(--sidebar-width); min-width: 0; }
.topbar {
    min-height: 84px; display: flex; align-items: center; justify-content: space-between;
    gap: 20px; padding: 18px 30px; background: color-mix(in srgb, var(--surface) 94%, transparent);
    border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20; backdrop-filter: blur(16px);
}
.topbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.topbar h1 { margin: 0; font-size: 22px; line-height: 1.2; letter-spacing: -.025em; }
.topbar p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.live-pill { display: inline-flex; align-items: center; gap: 8px; padding: 8px 11px; background: var(--green-soft); color: var(--green); border-radius: 999px; font-weight: 700; font-size: 12px; }
.live-pill span { width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 4px color-mix(in srgb, currentColor 15%, transparent); }
.icon-button { width: 38px; height: 38px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); cursor: pointer; }
.mobile-menu { display: none; }
.content { max-width: 1680px; margin: 0 auto; padding: 28px 30px 60px; }

.hero-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(280px, .7fr); gap: 18px; margin-bottom: 18px; }
.hero-card, .hero-side-card, .panel, .toolbar-card, .job-progress-card, .integration-hero {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.hero-card { padding: 32px; background: radial-gradient(circle at 85% 20%, rgba(87,128,255,.18), transparent 36%), var(--surface); }
.hero-card h2 { max-width: 690px; margin: 6px 0 10px; font-size: clamp(27px, 3.2vw, 44px); line-height: 1.08; letter-spacing: -.045em; }
.hero-card p { max-width: 700px; margin: 0; color: var(--muted); font-size: 15px; }
.hero-actions, .button-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.hero-side-card { padding: 26px; background: linear-gradient(145deg, #17233b, #202f50); color: #fff; }
.hero-side-card strong { display: block; font-size: 23px; margin: 6px 0; }
.hero-side-card p { color: #aebbd0; margin: 0 0 20px; }
.hero-side-label { font-size: 10px; font-weight: 800; letter-spacing: .13em; color: #8ea3c9; text-transform: uppercase; }
.system-check { display: flex; gap: 9px; align-items: center; margin-top: 10px; color: #dbe6f7; font-size: 13px; }
.system-check span { color: #52d7a7; }

.eyebrow { color: var(--primary); font-size: 10px; font-weight: 850; letter-spacing: .14em; text-transform: uppercase; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat-card { position: relative; overflow: hidden; padding: 21px; background: var(--surface); border: 1px solid var(--border); border-radius: 15px; box-shadow: var(--shadow-sm); }
.stat-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--accent, var(--primary)); }
.stat-card span, .stat-card small { display: block; }
.stat-card span { color: var(--muted); font-weight: 700; }
.stat-card strong { display: block; margin: 8px 0 2px; font-size: 30px; line-height: 1; letter-spacing: -.035em; }
.stat-card small { color: var(--muted); font-size: 11px; }
.accent-blue { --accent: var(--primary); }
.accent-green { --accent: var(--green); }
.accent-orange { --accent: var(--orange); }
.accent-purple { --accent: var(--purple); }
.accent-red { --accent: var(--red); }
.compact-stats { margin-top: 18px; }

.panel { padding: 22px; margin-bottom: 18px; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.panel-head h2, .results-header h2, .job-progress-head h2 { margin: 3px 0 0; font-size: 20px; letter-spacing: -.025em; }
.section-grid { display: grid; gap: 18px; }
.two-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.quick-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.quick-action { padding: 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); text-decoration: none; transition: .18s ease; }
.quick-action:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--primary) 40%, var(--border)); box-shadow: var(--shadow-sm); }
.quick-action > span { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; background: var(--primary-soft); color: var(--primary); font-weight: 900; }
.quick-action strong, .quick-action small { display: block; }
.quick-action strong { margin-top: 9px; }
.quick-action small { margin-top: 2px; color: var(--muted); }

.btn {
    appearance: none; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    min-height: 40px; padding: 9px 15px; border: 1px solid transparent; border-radius: 10px;
    text-decoration: none; font-weight: 750; cursor: pointer; transition: .17s ease; white-space: nowrap;
}
.btn:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.02); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 8px 18px color-mix(in srgb, var(--primary) 24%, transparent); }
.btn-secondary { background: var(--surface); border-color: var(--border); color: var(--text); }
.btn-amazon { background: #f6a51c; color: #1f1b14; }
.btn-ebay { background: #1769d2; color: #fff; }
.btn-success { background: var(--green-soft); color: var(--green); border-color: color-mix(in srgb, var(--green) 25%, transparent); }
.btn-warning { background: var(--orange-soft); color: var(--orange); border-color: color-mix(in srgb, var(--orange) 30%, transparent); }
.btn-danger { background: var(--red-soft); color: var(--red); border-color: color-mix(in srgb, var(--red) 30%, transparent); }
.btn-small { min-height: 34px; padding: 6px 10px; font-size: 12px; border-radius: 8px; }
.text-link { color: var(--primary); text-decoration: none; font-weight: 750; font-size: 12px; }
.text-link:hover { text-decoration: underline; }

.job-progress-card { margin-bottom: 18px; padding: 24px; }
.job-progress-head { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; }
.job-progress-head p { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; margin: 8px 0 0; }
.job-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.progress-track { height: 10px; margin-top: 20px; border-radius: 999px; overflow: hidden; background: var(--surface-3); }
.progress-bar { height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--primary), #7c65dc); transition: width .35s ease; }
.progress-meta { display: flex; justify-content: space-between; margin-top: 8px; color: var(--muted); font-size: 11px; }
.mini-stats { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin-top: 18px; }
.mini-stats > div { padding: 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 11px; }
.mini-stats span, .mini-stats strong { display: block; }
.mini-stats span { color: var(--muted); font-size: 10px; }
.mini-stats strong { margin-top: 3px; font-size: 18px; }
.status-badge, .connection-badge, .info-chip {
    display: inline-flex; align-items: center; justify-content: center; padding: 5px 9px; border-radius: 999px; font-size: 10px; font-weight: 850; text-transform: uppercase; letter-spacing: .04em;
}
.status-badge.running, .connection-badge.connected { color: var(--green); background: var(--green-soft); }
.status-badge.completed { color: var(--primary); background: var(--primary-soft); }
.status-badge.paused { color: var(--orange); background: var(--orange-soft); }
.status-badge.limited { color: var(--orange); background: var(--orange-soft); }
.status-badge.failed, .connection-badge.disconnected { color: var(--red); background: var(--red-soft); }
.info-chip { color: var(--primary); background: var(--primary-soft); }

.compact-list { display: grid; gap: 7px; }
.compact-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--border); border-radius: 11px; text-decoration: none; background: var(--surface-2); }
.compact-row:hover { border-color: color-mix(in srgb, var(--primary) 35%, var(--border)); }
.compact-main, .compact-end { display: flex; align-items: center; gap: 10px; }
.compact-main strong, .compact-main span { display: block; }
.compact-main span { color: var(--muted); font-size: 11px; }
.job-number { min-width: 37px; height: 37px; display: grid !important; place-items: center; border-radius: 9px; background: var(--primary-soft); color: var(--primary) !important; font-weight: 850; }

.tabs { display: inline-flex; gap: 5px; padding: 5px; margin-bottom: 18px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.tab { padding: 9px 15px; color: var(--muted); text-decoration: none; font-weight: 750; border-radius: 8px; }
.tab.active { background: var(--primary); color: #fff; }
.form-panel { padding: 22px; }
.form-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.compact-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid label, .toolbar-form label { display: grid; gap: 6px; min-width: 0; }
.form-grid label > span, .toolbar-form label > span, .setting-card > span { color: var(--muted); font-size: 11px; font-weight: 750; }
input, select {
    width: 100%; min-height: 42px; padding: 9px 11px; color: var(--text); background: var(--surface-2);
    border: 1px solid var(--border); border-radius: 9px; outline: none; transition: .16s ease;
}
input:focus, select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 14%, transparent); }
.span-2 { grid-column: span 2; }
.form-submit { align-self: end; }
.checkbox-label { display: flex !important; align-items: center; gap: 9px; min-height: 42px; }
.checkbox-label input { width: 17px; min-height: 17px; }
.form-status { margin-top: 12px; }
.featured-panel { border-color: color-mix(in srgb, var(--primary) 30%, var(--border)); background: radial-gradient(circle at 95% 5%, color-mix(in srgb, var(--primary) 12%, transparent), transparent 34%), var(--surface); }
.toolbar-card { padding: 14px 16px; margin-bottom: 18px; }
.toolbar-form { display: flex; align-items: end; gap: 12px; flex-wrap: wrap; }
.toolbar-form label { min-width: 230px; }
.results-header { display: flex; justify-content: space-between; align-items: end; gap: 18px; margin: 26px 2px 12px; }

.table-card { overflow: hidden; border: 1px solid var(--border); border-radius: 13px; background: var(--surface); }
.flush-table { border-radius: 0; border-left: 0; border-right: 0; border-bottom: 0; margin: 0 -22px -22px; }
.table-scroll { width: 100%; overflow-x: auto; }
.data-table { width: 100%; min-width: 980px; border-collapse: collapse; }
.product-table { min-width: 1360px; }
.data-table th { padding: 12px 13px; color: var(--muted); background: var(--surface-2); border-bottom: 1px solid var(--border); text-align: left; font-size: 10px; letter-spacing: .07em; text-transform: uppercase; white-space: nowrap; }
.data-table td { padding: 13px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: color-mix(in srgb, var(--primary) 2.7%, var(--surface)); }
.product-cell { min-width: 280px; }
.product-row { display: flex; gap: 11px; align-items: flex-start; }
.cover { width: 52px; height: 52px; object-fit: cover; border-radius: 9px; border: 1px solid var(--border); background: var(--surface-3); flex: 0 0 auto; }
.cover-placeholder { display: grid; place-items: center; color: var(--muted); font-size: 19px; }
.product-row strong { display: block; max-width: 260px; line-height: 1.35; }
.meta-line { color: var(--muted); font-size: 10px; margin-top: 3px; }
.value-strong { font-weight: 800; }
.tag-row { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 7px; }
.tag { display: inline-flex; padding: 3px 6px; border-radius: 6px; background: var(--surface-3); color: var(--muted); font-size: 9px; font-weight: 800; }
.decision-tag { color: var(--green); background: var(--green-soft); }
.decision-tag.exclusive { color: var(--purple); background: var(--purple-soft); }
.asin-link { color: var(--primary); font-weight: 850; text-decoration: none; font-size: 12px; }
.rank-badge { display: inline-flex; padding: 5px 8px; border-radius: 8px; color: var(--purple); background: var(--purple-soft); font-weight: 850; }
.profit-value { font-weight: 850; }
.positive { color: var(--green); }
.negative { color: var(--red); }
.muted { color: var(--muted); }
.price-field { display: flex; align-items: center; width: 102px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-2); overflow: hidden; }
.price-field span { padding-left: 9px; color: var(--muted); }
.price-field input { border: 0; background: transparent; min-height: 36px; padding-left: 5px; box-shadow: none; }
.action-stack { display: flex; flex-direction: column; align-items: stretch; gap: 6px; }
.action-stack.horizontal { flex-direction: row; align-items: center; }
.listing-status { min-width: 140px; font-size: 11px; font-weight: 700; }
.status-loading { color: var(--orange); }
.status-success { color: var(--green); }
.status-error, .inline-error { color: var(--red); }
.inline-error { margin-top: 5px; max-width: 180px; font-size: 10px; }
.small-progress { width: 130px; height: 6px; overflow: hidden; border-radius: 999px; background: var(--surface-3); }
.small-progress span { display: block; height: 100%; background: var(--primary); border-radius: inherit; }

.pagination { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; margin-top: 16px; color: var(--muted); }
.pagination > :last-child { justify-self: end; }
.empty-state { display: grid; place-items: center; padding: 40px 20px; text-align: center; color: var(--muted); border: 1px dashed var(--border); border-radius: 13px; background: var(--surface-2); }
.empty-state h3 { margin: 8px 0 3px; color: var(--text); }
.empty-state p { margin: 0; }
.empty-icon { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 14px; background: var(--primary-soft); color: var(--primary); font-size: 22px; font-weight: 900; }
.large-empty { min-height: 310px; }
.empty-inline { padding: 22px; color: var(--muted); background: var(--surface-2); border-radius: 11px; text-align: center; }

.alert { padding: 14px 16px; margin-bottom: 18px; border-radius: 11px; border: 1px solid; }
.alert-error { color: var(--red); background: var(--red-soft); border-color: color-mix(in srgb, var(--red) 25%, transparent); }
.alert-info { color: var(--primary); background: var(--primary-soft); border-color: color-mix(in srgb, var(--primary) 25%, transparent); }
.alert-warning { color: var(--orange); background: var(--orange-soft); border-color: color-mix(in srgb, var(--orange) 30%, transparent); }
.inventory-limit-alert { margin-top: 14px; margin-bottom: 14px; }
.integration-hero { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 28px; margin-bottom: 18px; }
.integration-hero h2 { margin: 4px 0 6px; font-size: 30px; letter-spacing: -.035em; }
.integration-hero p { margin: 0; color: var(--muted); }
.amazon-hero { background: radial-gradient(circle at 88% 20%, rgba(246,165,28,.18), transparent 34%), var(--surface); }
.ebay-hero { background: radial-gradient(circle at 88% 20%, rgba(23,105,210,.18), transparent 34%), var(--surface); }
.result-console { min-height: 105px; max-height: 270px; overflow: auto; margin: 14px 0 0; padding: 13px; background: #0f1724; color: #b9c7da; border-radius: 10px; font: 11px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre-wrap; word-break: break-word; }
.inline-form { display: flex; gap: 9px; }
.inline-form input { flex: 1; }

.settings-list { display: grid; gap: 9px; }
.settings-row { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 14px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 11px; }
.settings-row strong, .settings-row span { display: block; }
.settings-row > div span { color: var(--muted); font-size: 10px; }
.priority-list { display: flex; flex-wrap: wrap; gap: 9px; }
.priority-item { display: flex; align-items: center; gap: 9px; padding: 11px 14px; border: 1px solid var(--border); border-radius: 11px; background: var(--surface-2); }
.priority-item span { width: 23px; height: 23px; display: grid; place-items: center; border-radius: 7px; background: var(--primary-soft); color: var(--primary); font-weight: 850; }
.help-text { color: var(--muted); font-size: 12px; }
code { padding: 2px 5px; border-radius: 5px; background: var(--surface-3); }
.settings-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.setting-card { min-height: 120px; display: flex; flex-direction: column; justify-content: center; padding: 16px; border: 1px solid var(--border); background: var(--surface-2); border-radius: 12px; }
.setting-card strong { margin-top: 7px; font-size: 17px; }
.setting-card small { margin-top: 5px; color: var(--muted); }
.setting-card select { margin-top: 8px; }

.toast-container { position: fixed; right: 20px; bottom: 20px; z-index: 100; display: grid; gap: 9px; width: min(360px, calc(100vw - 40px)); }
.toast { padding: 13px 15px; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--primary); border-radius: 11px; box-shadow: var(--shadow); animation: toast-in .2s ease; }
.toast.success { border-left-color: var(--green); }
.toast.error { border-left-color: var(--red); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
.sidebar-overlay { display: none; }

@media (max-width: 1200px) {
    .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .mini-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .form-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
    .sidebar { transform: translateX(-100%); transition: transform .2s ease; }
    .sidebar.open { transform: translateX(0); }
    .sidebar-overlay { position: fixed; inset: 0; z-index: 25; background: rgba(7,12,22,.55); }
    .sidebar-overlay.show { display: block; }
    .app-main { margin-left: 0; }
    .mobile-menu { display: inline-grid; place-items: center; }
    .hero-grid, .two-columns { grid-template-columns: 1fr; }
    .seller-top-grid { grid-template-columns: 1fr; }
    .topbar { padding: 15px 18px; }
    .content { padding: 20px 18px 45px; }
    .form-grid, .compact-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .settings-grid { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
    .topbar p, .live-pill { display: none; }
    .topbar h1 { font-size: 19px; }
    .stats-grid, .mini-stats, .quick-grid, .form-grid, .compact-form { grid-template-columns: 1fr; }
    .span-2 { grid-column: auto; }
    .job-progress-head, .integration-hero, .results-header, .panel-head { flex-direction: column; align-items: stretch; }
    .job-actions, .button-row, .inline-form { flex-direction: column; }
    .progress-meta { flex-direction: column; gap: 3px; }
    .toolbar-form { align-items: stretch; }
    .toolbar-form label { min-width: 100%; }
    .pagination { grid-template-columns: 1fr; text-align: center; }
    .pagination > * { justify-self: stretch !important; }
    .hero-card, .hero-side-card, .panel, .job-progress-card, .integration-hero { padding: 18px; }
    .flush-table { margin: 0 -18px -18px; }
}

/* Native job action forms: reliable even when the browser cached an older app.js. */
.inline-action-form {
    display: inline-flex;
    margin: 0;
    padding: 0;
}

/* Amazon bulk inventory import */
.amazon-import-panel { margin-top: 18px; }
.import-job-list { display: grid; gap: 12px; }
.import-job-card { padding: 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.import-job-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; }
.import-job-main-count { min-width: 110px; text-align: right; }
.import-job-main-count strong, .import-job-main-count small { display: block; }
.import-job-main-count strong { font-size: 22px; letter-spacing: -.03em; }
.import-job-main-count small { color: var(--muted); }
.large-progress { height: 11px; margin-top: 14px; }
.large-progress span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #f6a51c, #ffca62); transition: width .3s ease; }
.import-progress-meta { flex-wrap: wrap; gap: 12px; justify-content: flex-start; }
.import-job-actions { margin-top: 13px; }

@media (max-width: 620px) {
    .import-job-head { flex-direction: column; }
    .import-job-main-count { text-align: left; }
}


/* v1.0.7 — Opportunity filters and transparent Amazon import */
.opportunities-toolbar { display: grid; gap: 18px; }
.opportunities-filter-form { align-items: end; }
.opportunities-filter-form label { min-width: 145px; }
.compact-check { align-self: center; padding-top: 20px; min-width: auto !important; }
.amazon-import-launcher {
    display: flex; align-items: end; flex-wrap: wrap; gap: 14px;
    padding-top: 16px; border-top: 1px solid var(--border);
}
.import-formula-copy { display: grid; gap: 3px; min-width: 280px; margin-right: auto; }
.import-formula-copy span { color: var(--muted); font-size: .86rem; }
.shipping-input-label { min-width: 175px; }
.input-with-suffix { display: flex; align-items: center; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); overflow: hidden; }
.input-with-suffix input { border: 0 !important; min-width: 0; width: 115px; box-shadow: none !important; }
.input-with-suffix span { color: var(--muted); padding: 0 11px; font-size: .8rem; font-weight: 700; }
.fixed-multiplier { display: grid; gap: 5px; min-width: 105px; }
.fixed-multiplier span { color: var(--muted); font-size: .76rem; font-weight: 700; text-transform: uppercase; }
.fixed-multiplier strong { min-height: 42px; display: flex; align-items: center; padding: 0 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.result-breakdown { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 8px; color: var(--muted); font-size: .84rem; }
.result-breakdown span { padding-right: 14px; border-right: 1px solid var(--border); }
.result-breakdown span:last-child { border-right: 0; }
.compact-details { margin-top: 10px; }
.compact-details summary, .import-breakdown-details summary { cursor: pointer; color: var(--primary); font-size: .82rem; font-weight: 800; }
.detail-list, .import-error-list { display: grid; gap: 7px; margin-top: 10px; }
.detail-list > div, .import-error-list > div { display: flex; justify-content: space-between; gap: 14px; font-size: .78rem; }
.detail-list span, .import-error-list span { color: var(--muted); overflow-wrap: anywhere; }
.import-performance-grid, .breakdown-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.import-performance-grid > div, .breakdown-grid > div { padding: 11px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); display: grid; gap: 4px; }
.import-performance-grid span, .breakdown-grid span { color: var(--muted); font-size: .76rem; }
.import-performance-grid strong, .breakdown-grid strong { font-size: .92rem; }
.import-breakdown-details { margin-top: 14px; padding: 12px 14px; border: 1px dashed var(--border); border-radius: 12px; }
.import-error-list { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
@media (max-width: 900px) {
    .amazon-import-launcher { align-items: stretch; }
    .amazon-import-launcher > * { width: 100%; }
    .input-with-suffix input { width: 100%; }
    .import-performance-grid, .breakdown-grid { grid-template-columns: 1fr; }
    .opportunity-summary-header { align-items: flex-start; }
}

.btn-retro {
    background: linear-gradient(135deg, #0a8f62, #14b87a);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 8px 22px rgba(10, 143, 98, .2);
}
.btn-retro:hover { filter: brightness(.97); transform: translateY(-1px); }
.retro-import-panel { border-top: 3px solid #12a66f; }
.retro-import-card .progress-track span {
    background: linear-gradient(90deg, #0a8f62, #22c58b);
}

/* v1.0.10 — explicit Discogs → Amazon condition preview */
.condition-preview-line {
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.condition-arrow {
    opacity: .7;
    font-weight: 700;
}
.condition-preview-badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(148, 163, 184, .16);
    border: 1px solid rgba(148, 163, 184, .28);
    font-size: 12px;
    font-weight: 700;
}
.condition-preview-badge.condition-new {
    background: rgba(34, 197, 94, .14);
    border-color: rgba(34, 197, 94, .38);
}

/* Amazon Health Guard v2.3.1 */
.health-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 28px;
    margin-bottom: 18px;
    overflow: hidden;
}
.health-hero.health-safe {
    background: radial-gradient(circle at 88% 20%, color-mix(in srgb, var(--green) 17%, transparent), transparent 34%), var(--surface);
    border-color: color-mix(in srgb, var(--green) 28%, var(--border));
}
.health-hero.health-danger {
    background: radial-gradient(circle at 88% 20%, color-mix(in srgb, var(--red) 18%, transparent), transparent 34%), var(--surface);
    border-color: color-mix(in srgb, var(--red) 36%, var(--border));
}
.health-hero h2 { margin: 5px 0 8px; font-size: 31px; letter-spacing: -.035em; }
.health-hero p { max-width: 850px; margin: 0; color: var(--muted); }
.health-hero-status { display: grid; justify-items: end; gap: 9px; min-width: 220px; }
.health-hero-status small { color: var(--muted); text-align: right; }
.health-note { color: var(--muted); margin: 0; }
.health-smallprint { margin: 16px 0 0; padding: 13px; color: var(--muted); background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; font-size: 12px; }
.health-metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.health-metric-card { position: relative; padding: 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); overflow: hidden; }
.health-metric-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--green); }
.health-metric-card.problem::before { background: var(--red); }
.health-metric-card span, .health-metric-card small { display: block; overflow-wrap: anywhere; }
.health-metric-card span { color: var(--muted); font-size: 11px; font-weight: 750; }
.health-metric-card strong { display: block; margin: 8px 0 3px; font-size: 23px; }
.health-metric-card small { color: var(--muted); font-size: 10px; }
.health-table td small { display: block; margin-top: 4px; color: var(--muted); max-width: 470px; }
.health-table td:nth-child(4) { min-width: 300px; }
.health-table td:nth-child(3) { min-width: 150px; }
.health-stats .stat-card strong { font-size: 25px; overflow-wrap: anywhere; }

@media (max-width: 1100px) {
    .health-metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
    .health-hero { flex-direction: column; align-items: stretch; }
    .health-hero-status { justify-items: start; min-width: 0; }
    .health-hero-status small { text-align: left; }
    .health-metric-grid { grid-template-columns: 1fr; }
}

.health-confirmation-warning {
    border-color: #f59e0b;
    background: #fffbeb;
}
.health-confirmation-warning strong {
    color: #92400e;
}
.health-confirmation-warning p {
    margin: 6px 0 0;
    color: #78350f;
}

/* Amazon account lock — Health Guard v2.3.1 */
.amazon-account-switch {
    border-width: 2px;
}

.account-switch-danger {
    border-color: rgba(220, 38, 38, 0.45);
    background: linear-gradient(180deg, rgba(127, 29, 29, 0.08), rgba(255, 255, 255, 0));
}

.account-switch-safe {
    border-color: rgba(22, 163, 74, 0.38);
    background: linear-gradient(180deg, rgba(22, 163, 74, 0.06), rgba(255, 255, 255, 0));
}

.account-current-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin: 18px 0;
}

.account-current-grid > div {
    border: 1px solid var(--border, #d9e1ea);
    border-radius: 12px;
    padding: 13px 14px;
    background: rgba(255, 255, 255, 0.62);
}

.account-current-grid span,
.account-current-grid strong {
    display: block;
}

.account-current-grid span {
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    opacity: 0.72;
    margin-bottom: 5px;
}

.account-current-grid strong {
    overflow-wrap: anywhere;
}

.account-switch-explanation {
    margin-bottom: 16px;
}

.account-switch-methods {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.account-switch-card {
    display: grid;
    align-content: start;
    gap: 12px;
    border: 1px solid var(--border, #d9e1ea);
    border-radius: 14px;
    padding: 18px;
    background: rgba(255, 255, 255, 0.7);
}

.account-switch-card h3 {
    margin: 2px 0 5px;
}

.account-switch-card p {
    margin: 0;
    opacity: 0.78;
}

.account-switch-card label {
    display: grid;
    gap: 6px;
}

.account-switch-card label > span {
    font-size: 0.84rem;
    font-weight: 700;
}

.account-switch-card input,
.account-switch-card select {
    width: 100%;
}

.account-advanced {
    border: 1px dashed var(--border, #d9e1ea);
    border-radius: 10px;
    padding: 10px 12px;
}

.account-advanced summary {
    cursor: pointer;
    font-weight: 700;
}

.account-advanced[open] {
    display: grid;
    gap: 12px;
}

@media (max-width: 950px) {
    .account-current-grid,
    .account-switch-methods {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 650px) {
    .account-current-grid,
    .account-switch-methods {
        grid-template-columns: 1fr;
    }
}
.account-manager-list{display:grid;gap:10px;margin-top:14px}.account-manager-row{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:14px 16px;border:1px solid #dfe6f2;border-radius:14px;background:#fff}.account-manager-row small{display:block;color:#718096;margin-top:4px}


/* Amazon multi-account manual import v2.3.8 */
.manual-account-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-top:12px}
.manual-account-grid label{display:flex;flex-direction:column;gap:6px;font-weight:700}
.manual-account-grid input{width:100%;box-sizing:border-box}
.manual-account-wide{grid-column:1/-1}
.manual-account-check{grid-column:1/-1;flex-direction:row!important;align-items:center;font-weight:600!important}
.manual-account-check input{width:auto}
@media(max-width:800px){.manual-account-grid{grid-template-columns:1fr}.manual-account-wide,.manual-account-check{grid-column:1}}
