:root {
  --bg: #f5f1e8;
  --panel: #fffdf8;
  --panel-strong: #fff8ea;
  --ink: #1f2933;
  --muted: #5c6b73;
  --line: #dccfb7;
  --brand: #0f6d5f;
  --brand-dark: #0b4d43;
  --accent: #c7672b;
  --danger: #b83b3b;
  --ok: #2c7a58;
  --warn: #9a6700;
  --shadow: 0 18px 40px rgba(43, 37, 24, 0.08);
  font-family: "Avenir Next", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(199, 103, 43, 0.18), transparent 28%),
    radial-gradient(circle at top right, rgba(15, 109, 95, 0.18), transparent 32%),
    linear-gradient(180deg, #f4efe4 0%, #f5f1e8 35%, #f8f5ee 100%);
}

.hero,
.shell {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
}

.hero {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 20px;
  padding: 40px 0 24px;
}

.hero-copy,
.hero-note,
.panel {
  background: rgba(255, 253, 248, 0.94);
  border: 1px solid rgba(220, 207, 183, 0.9);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.hero-copy,
.hero-note {
  padding: 28px;
}

.eyebrow {
  margin: 0 0 8px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 12px;
  color: var(--brand-dark);
  font-weight: 700;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  font-size: clamp(32px, 5vw, 56px);
  line-height: 0.98;
  margin-bottom: 14px;
}

.subtitle {
  font-size: 17px;
  line-height: 1.6;
  color: var(--muted);
}

.badge-line {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}

.badge.muted {
  background: #e7dfcf;
  color: var(--ink);
}

.shell {
  display: grid;
  gap: 20px;
  padding-bottom: 36px;
}

.panel {
  padding: 22px;
}

.upload-panel {
  background: linear-gradient(180deg, rgba(255, 248, 234, 0.96), rgba(255, 253, 248, 0.94));
}

.section-head,
.actions,
.upload-grid,
.grid-two,
.export-row,
.stats-grid,
.actions.wide {
  display: flex;
  gap: 14px;
}

.section-head {
  justify-content: space-between;
  align-items: flex-start;
}

.upload-grid,
.grid-two {
  align-items: stretch;
}

.upload-grid {
  margin-top: 18px;
}

.grid-two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dropzone {
  position: relative;
  flex: 1;
  min-height: 170px;
  border: 2px dashed rgba(15, 109, 95, 0.35);
  border-radius: 22px;
  padding: 24px;
  background: rgba(15, 109, 95, 0.06);
  overflow: hidden;
}

.dropzone input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.drop-title {
  display: block;
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 8px;
}

.drop-text,
.tiny-note,
.hero-note p,
.section-head p {
  color: var(--muted);
  line-height: 1.55;
}

.upload-actions {
  display: grid;
  gap: 12px;
  width: min(280px, 100%);
}

.btn,
select,
input[type="text"],
input[type="file"] {
  font: inherit;
}

.btn {
  border: 0;
  border-radius: 16px;
  padding: 13px 16px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.16s ease, opacity 0.16s ease, background 0.16s ease;
  text-decoration: none;
  text-align: center;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn.primary {
  background: var(--brand);
  color: #fff;
}

.btn.accent {
  background: var(--accent);
  color: #fff;
}

.btn.ghost {
  background: #ece4d4;
  color: var(--ink);
}

.notice,
.mini-log {
  border-radius: 18px;
  padding: 14px 16px;
  margin-top: 16px;
  background: #f7f1e4;
  border: 1px solid var(--line);
  white-space: pre-wrap;
}

.notice.ok {
  border-color: rgba(44, 122, 88, 0.32);
  background: rgba(44, 122, 88, 0.09);
}

.notice.err {
  border-color: rgba(184, 59, 59, 0.3);
  background: rgba(184, 59, 59, 0.09);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  margin: 18px 0 12px;
}

.stat-card {
  padding: 16px;
  border-radius: 18px;
  background: var(--panel-strong);
  border: 1px solid rgba(220, 207, 183, 0.8);
}

.stat-card b {
  display: block;
  font-size: 28px;
  margin-top: 8px;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  margin-top: 14px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

th,
td {
  border-bottom: 1px solid #ece4d4;
  padding: 12px 14px;
  vertical-align: top;
  text-align: left;
}

th {
  position: sticky;
  top: 0;
  background: #f7f1e4;
  z-index: 1;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.pill.ok {
  background: rgba(44, 122, 88, 0.12);
  color: var(--ok);
}

.pill.err {
  background: rgba(184, 59, 59, 0.12);
  color: var(--danger);
}

.export-stack {
  display: grid;
  gap: 14px;
}

.export-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.export-row label {
  font-weight: 700;
}

select {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 14px;
  padding: 12px;
  margin: 8px 0 10px;
}

.legacy-panel {
  background: rgba(236, 228, 212, 0.72);
}

@media (max-width: 920px) {
  .hero,
  .grid-two,
  .upload-grid {
    grid-template-columns: 1fr;
    display: grid;
  }

  .hero {
    padding-top: 24px;
  }

  .section-head,
  .actions {
    flex-direction: column;
  }
}
