:root {
  --bg: #f4f7fc;
  --card: rgba(255, 255, 255, 0.92);
  --card-strong: #ffffff;
  --border: rgba(141, 161, 196, 0.24);
  --shadow: 0 20px 60px rgba(68, 92, 138, 0.12);
  --text: #22314f;
  --muted: #7a89a6;
  --accent: #4f6bff;
  --accent-soft: rgba(79, 107, 255, 0.1);
  --danger: #d04d63;
  --success: #12916b;
  --warning: #d4942a;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", "Inter", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(79, 107, 255, 0.12), transparent 26%),
    radial-gradient(circle at bottom right, rgba(53, 187, 255, 0.1), transparent 24%),
    var(--bg);
}

.shell { display: grid; grid-template-columns: 290px minmax(0, 1fr); min-height: 100vh; }
.sidebar { padding: 22px 18px; border-right: 1px solid rgba(141, 161, 196, 0.18); background: rgba(255, 255, 255, 0.72); backdrop-filter: blur(12px); }
.brand-card, .sidebar-note, .card, .hero { border: 1px solid var(--border); background: var(--card); box-shadow: var(--shadow); }
.brand-card { display: flex; gap: 14px; align-items: center; padding: 16px; border-radius: 24px; }
.brand-mark { width: 52px; height: 52px; border-radius: 18px; display: grid; place-items: center; background: linear-gradient(135deg, #edf2ff, #ffffff); color: var(--accent); font-weight: 700; font-size: 24px; border: 1px solid rgba(79, 107, 255, 0.14); }
.brand-title { font-weight: 700; }
.brand-subtitle, .muted { color: var(--muted); }
.sidebar-section { margin-top: 20px; }
.sidebar-label, .card-label, .eyebrow { text-transform: uppercase; letter-spacing: 0.12em; font-size: 11px; color: #9aa8c2; font-weight: 700; }
.pill, .hero-pill { display: inline-flex; align-items: center; padding: 10px 14px; border-radius: 999px; border: 1px solid rgba(141, 161, 196, 0.26); background: rgba(255, 255, 255, 0.8); font-size: 14px; margin: 8px 8px 0 0; }
.pill.active { background: var(--accent-soft); color: var(--accent); }
.menu { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.menu a { color: #6d7f9b; text-decoration: none; padding: 11px 14px; border-radius: 16px; }
.menu a:hover { background: rgba(79, 107, 255, 0.08); color: var(--accent); }
.sidebar-note { margin-top: 22px; padding: 16px; border-radius: 24px; color: #667793; line-height: 1.5; }
.main { padding: 24px; }
.hero { display: flex; justify-content: space-between; gap: 24px; padding: 24px 26px; border-radius: 30px; margin-bottom: 18px; }
.hero h1, .card h2 { margin: 8px 0 12px; }
.hero p { max-width: 760px; color: var(--muted); }
.hero-pills { display: flex; flex-wrap: wrap; align-content: flex-start; justify-content: flex-end; }
.grid { display: grid; gap: 18px; margin-bottom: 18px; }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card { padding: 22px; border-radius: 28px; }
.metric-card { min-height: 178px; }
.metric-value { font-size: 64px; line-height: 1; margin: 16px 0 14px; font-weight: 700; color: var(--danger); }
.metric-value.metric-small { font-size: 44px; color: var(--text); }
.metric-copy { color: var(--muted); }
.button { border: 0; border-radius: 16px; background: linear-gradient(135deg, #5b76ff, #6dc7ff); color: white; padding: 13px 18px; font-weight: 700; cursor: pointer; box-shadow: 0 16px 32px rgba(91, 118, 255, 0.24); }
.button:hover { transform: translateY(-1px); }
.status-list { display: grid; gap: 10px; margin-top: 18px; }
.status-item, .result-card, .match-card { border: 1px solid var(--border); border-radius: 20px; background: var(--card-strong); }
.status-item { padding: 14px 16px; }
.upload-form, .search-form { display: grid; gap: 14px; }
.upload-form { grid-template-columns: 1fr auto; align-items: center; }
.search-form { grid-template-columns: 2fr repeat(3, minmax(0, 1fr)) auto; align-items: end; }
.file-row { display: grid; gap: 8px; }
.file-input { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; }
.file-pick { display: inline-flex; align-items: center; justify-content: center; width: fit-content; min-width: 160px; border: 1px solid rgba(141, 161, 196, 0.28); background: rgba(250, 252, 255, 0.92); border-radius: 16px; padding: 14px 16px; cursor: pointer; font: inherit; color: var(--text); }
.file-pick:hover { border-color: rgba(79, 107, 255, 0.36); background: rgba(79, 107, 255, 0.05); }
.file-name { color: var(--muted); font-size: 14px; padding-left: 2px; }
label span { display: block; margin-bottom: 8px; font-size: 13px; color: #8b9bb6; }
input, textarea { width: 100%; border: 1px solid rgba(141, 161, 196, 0.28); background: rgba(250, 252, 255, 0.92); border-radius: 16px; padding: 14px 16px; font: inherit; color: var(--text); }
textarea { min-height: 290px; resize: vertical; }
.catalog-summary { margin: 14px 0; color: var(--muted); }
.sample-table-wrap { overflow: auto; }
.sample-table { width: 100%; border-collapse: collapse; }
.sample-table th, .sample-table td { text-align: left; padding: 12px 10px; border-bottom: 1px solid rgba(141, 161, 196, 0.18); }
.results-grid { display: grid; gap: 18px; margin: 18px 0; }
.result-card { padding: 20px; }
.result-top { display: flex; justify-content: space-between; gap: 18px; align-items: start; }
.result-number { color: var(--accent); font-weight: 700; }
.result-price { font-size: 30px; font-weight: 700; }
.badge-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 14px; }
.badge { border-radius: 999px; padding: 8px 12px; font-size: 13px; border: 1px solid rgba(141, 161, 196, 0.2); background: rgba(244, 247, 252, 0.9); }
.badge.good { background: rgba(18, 145, 107, 0.12); color: var(--success); }
.badge.warn { background: rgba(212, 148, 42, 0.12); color: var(--warning); }
.match-grid { display: grid; gap: 10px; margin-top: 14px; }
.match-card { padding: 14px; }
.match-head { display: flex; justify-content: space-between; gap: 10px; font-weight: 700; }
.notes-list { margin: 0; padding-left: 18px; color: var(--muted); line-height: 1.6; }
a.inline-link { color: var(--accent); text-decoration: none; }

@media (max-width: 1100px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { border-right: 0; border-bottom: 1px solid rgba(141, 161, 196, 0.18); }
  .grid-3, .grid-2, .search-form, .upload-form { grid-template-columns: 1fr; }
  .hero { flex-direction: column; }
}
