:root {
  --bg: #f6f1e8;
  --paper: #fffaf1;
  --ink: #1d1a16;
  --muted: #6e675c;
  --line: #ded3c3;
  --accent: #111111;
  --soft: #efe4d2;
  --good: #d9ead3;
  --bad: #f4cccc;
  --pair1: #fff2cc;
  --pair2: #d9ead3;
  --pair3: #d9eaf7;
  --pair4: #f4cccc;
  --pair5: #ead1dc;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, Segoe UI, Arial, sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at top left, #fffdf8 0, var(--bg) 42%, #ece0cf 100%);
}

.app-shell { max-width: 1280px; margin: 0 auto; padding: 24px; }
.hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255,250,241,.86);
  box-shadow: 0 18px 50px rgba(30, 24, 14, .08);
}
.eyebrow { margin: 0 0 8px; color: var(--muted); font-size: 13px; letter-spacing: .12em; text-transform: uppercase; }
h1 { margin: 0; font-size: clamp(34px, 5vw, 56px); letter-spacing: -0.05em; }
.subtitle { max-width: 760px; color: var(--muted); line-height: 1.55; font-size: 17px; }
.badge { padding: 10px 14px; border-radius: 999px; background: var(--ink); color: #fffaf1; white-space: nowrap; font-size: 13px; }

main { display: grid; gap: 18px; margin-top: 18px; }
.panel, .metrics {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255,250,241,.92);
  padding: 18px;
  box-shadow: 0 12px 36px rgba(30, 24, 14, .06);
}
.grid-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.file-card h2, .panel h2 { margin: 0 0 6px; font-size: 20px; }
.hint { margin: 0 0 12px; color: var(--muted); font-size: 14px; }
.drop-zone {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 98px;
  border: 1.5px dashed #b8aa96;
  border-radius: 16px;
  background: #fffdf8;
  cursor: pointer;
  transition: .15s ease;
  font-weight: 700;
}
.drop-zone:hover { transform: translateY(-1px); border-color: var(--ink); }
.drop-zone input { display: none; }
.file-meta { margin: 10px 0; font-size: 13px; color: var(--muted); word-break: break-all; }
.sheet-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.sheet-row label { min-width: 80px; color: var(--muted); font-size: 13px; }
select, input[type="number"] {
  border: 1px solid var(--line);
  background: #fffdf8;
  border-radius: 10px;
  padding: 9px 10px;
  min-width: 150px;
}
.section-title { display: flex; justify-content: space-between; gap: 16px; align-items: center; margin-bottom: 12px; }
.options-row, .filter-row, .button-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.options-row label, .filter-row label { background: #fffdf8; border: 1px solid var(--line); padding: 8px 10px; border-radius: 999px; font-size: 14px; }
.pair-grid { display: grid; gap: 10px; margin-top: 14px; }
.pair-row { display: grid; grid-template-columns: 90px minmax(0, 1fr) minmax(0, 1fr); gap: 10px; align-items: center; padding: 10px; border-radius: 14px; border: 1px solid var(--line); background: #fffdf8; }
.pair-label { border-radius: 999px; padding: 7px 10px; font-weight: 800; text-align: center; font-size: 13px; border: 1px solid rgba(0,0,0,.08); }
.pair-row select { width: 100%; }
.action-panel { display: grid; gap: 14px; }
button {
  border: 0;
  border-radius: 12px;
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 800;
  transition: .15s ease;
}
button:disabled { opacity: .45; cursor: not-allowed; }
button:not(:disabled):hover { transform: translateY(-1px); }
.primary-btn { background: var(--accent); color: #fffaf1; }
.secondary-btn, .small-btn { background: var(--soft); color: var(--ink); border: 1px solid var(--line); }
.small-btn { padding: 8px 10px; }
.metrics { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.metric-card { background: #fffdf8; border: 1px solid var(--line); border-radius: 16px; padding: 14px; }
.metric-card span { display: block; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.metric-card strong { display: block; font-size: 26px; margin-top: 6px; }
.table-wrap { overflow: auto; max-height: 560px; border: 1px solid var(--line); border-radius: 14px; background: #fffdf8; }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th, td { border-bottom: 1px solid #eadfce; border-right: 1px solid #eadfce; padding: 8px 10px; text-align: left; white-space: nowrap; }
th { position: sticky; top: 0; z-index: 1; background: #efe4d2; font-weight: 900; }
.status-in { background: var(--good); font-weight: 800; }
.status-not-in { background: var(--bad); font-weight: 800; }
.pair-1 { background: var(--pair1); }
.pair-2 { background: var(--pair2); }
.pair-3 { background: var(--pair3); }
.pair-4 { background: var(--pair4); }
.pair-5 { background: var(--pair5); }
footer { text-align: center; color: var(--muted); padding: 22px; font-size: 13px; }

@media (max-width: 860px) {
  .grid-two, .metrics { grid-template-columns: 1fr; }
  .hero, .section-title { flex-direction: column; align-items: flex-start; }
  .pair-row { grid-template-columns: 1fr; }
}
