:root {
  color-scheme: light;
  --red: #d81920;
  --red-dark: #8f1117;
  --ink: #111111;
  --muted: #626262;
  --line: #dedede;
  --soft: #f5f5f5;
  --white: #ffffff;
  --green: #0b6b3a;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: #f2f2f2;
  color: var(--ink);
  font-family: Arial, "Noto Sans Thai", Tahoma, sans-serif;
  line-height: 1.5;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, .6fr);
  gap: 32px;
  padding: 56px max(24px, calc((100vw - 1180px) / 2));
  background: var(--ink);
  color: var(--white);
  border-top: 8px solid var(--red);
}

.eyebrow, .step {
  margin: 0 0 8px;
  color: var(--red);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .12em;
}

.hero .eyebrow { color: #ff686d; }
h1 { max-width: 760px; margin: 0; font-size: clamp(34px, 6vw, 64px); line-height: 1; letter-spacing: -.04em; }
.lede { max-width: 720px; margin: 18px 0 0; color: #d7d7d7; font-size: 18px; }
.safety-note { align-self: end; padding: 20px; background: #232323; border-left: 5px solid var(--red); }
.safety-note strong, .safety-note span { display: block; }
.safety-note span { margin-top: 8px; color: #c9c9c9; font-size: 13px; }

main { width: min(1180px, calc(100% - 32px)); margin: 32px auto 56px; }
.panel { margin-bottom: 20px; padding: 28px; background: var(--white); border: 1px solid var(--line); box-shadow: 0 10px 28px rgb(0 0 0 / 5%); }
.section-heading { margin-bottom: 18px; }
.section-heading h2 { margin: 0; font-size: 28px; letter-spacing: -.02em; }
.inline-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
h3 { margin: 28px 0 10px; font-size: 16px; }

.file-drop { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 76px; padding: 18px 20px; background: var(--soft); border: 1px dashed #9b9b9b; font-weight: 700; }
.file-drop input { max-width: 100%; }
.status-message { min-height: 24px; margin: 14px 0 0; color: var(--muted); }

.badge { padding: 7px 12px; border-radius: 999px; background: #fff0f0; color: var(--red-dark); font-size: 12px; font-weight: 800; text-transform: uppercase; }
.badge[data-state="approved"] { background: #e4f6ec; color: var(--green); }
.mapping-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin: 20px 0; }
.mapping-grid label { display: grid; gap: 5px; color: var(--muted); font-size: 12px; font-weight: 700; }
select, button { min-height: 42px; border-radius: 0; font: inherit; }
select { width: 100%; padding: 8px; border: 1px solid #bcbcbc; background: var(--white); }
button { padding: 10px 18px; border: 1px solid var(--red); background: var(--red); color: var(--white); font-weight: 800; cursor: pointer; }
button.secondary { background: var(--white); color: var(--red-dark); }
button:disabled { border-color: #c7c7c7; background: #d9d9d9; color: #777; cursor: not-allowed; }

.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.kpi-grid article { min-height: 128px; padding: 18px; background: var(--ink); color: var(--white); border-top: 5px solid var(--red); }
.kpi-grid span, .kpi-grid strong, .kpi-grid small { display: block; }
.kpi-grid span { color: #c9c9c9; font-size: 12px; font-weight: 700; }
.kpi-grid strong { margin: 12px 0 4px; font-size: 27px; line-height: 1; }
.kpi-grid small { color: #a9a9a9; }
.split { display: grid; grid-template-columns: .7fr 1.3fr; gap: 24px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }

.table-scroll { overflow-x: auto; border: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { background: var(--ink); color: var(--white); font-size: 11px; letter-spacing: .05em; text-transform: uppercase; }
tbody tr:nth-child(even) { background: var(--soft); }
footer { padding: 24px; background: var(--ink); color: #bdbdbd; text-align: center; font-size: 12px; }

@media (max-width: 780px) {
  .hero, .split { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .inline-heading { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 480px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .panel { padding: 20px; }
}
