:root {
  --bg: #0f1412;
  --surface: #171e1b;
  --surface-2: #1e2723;
  --line: #2b3832;
  --text: #e8eee9;
  --muted: #9aaba2;
  --accent: #3dba86;
  --accent-hover: #4dcc96;
  --accent-dim: #1c3d30;
  --danger: #e07a6a;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
  --radius: 16px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background:
    radial-gradient(1200px 500px at 10% -10%, #1d3a2e 0%, transparent 55%),
    var(--bg);
  color: var(--text);
}

.app {
  max-width: 1180px;
  margin: 0 auto;
  padding: 40px 20px 80px;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 28px;
}

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

h1 {
  margin: 0 0 10px;
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  letter-spacing: -0.03em;
}

.lede {
  margin: 0;
  max-width: 58ch;
  color: var(--muted);
  line-height: 1.5;
}

.btn {
  border: 0;
  border-radius: 10px;
  padding: 11px 16px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
}

.btn-ghost:not(:disabled):hover {
  color: var(--text);
  border-color: #4a5d54;
}

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

.btn-primary:hover {
  background: var(--accent-hover);
}

.dropzone {
  position: relative;
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 210px;
  padding: 32px;
  border: 1.5px dashed #3b5248;
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.dropzone:hover,
.dropzone.dragover {
  border-color: var(--accent);
  background: var(--accent-dim);
}

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

.dropzone-icon {
  color: var(--accent);
}

.dropzone-title {
  margin: 8px 0 0;
  font-weight: 600;
}

.dropzone-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 20px;
}

.stats article {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
}

.stat-label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 6px;
}

.stats strong {
  font-size: 1.4rem;
}

.errors {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 12px;
  background: #2a1b18;
  border: 1px solid #5a322c;
  color: #f2c4bc;
  font-size: 0.92rem;
  line-height: 1.5;
}

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin: 22px 0 12px;
}

.toolbar p {
  margin: 0;
  color: var(--muted);
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th,
td {
  padding: 11px 12px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

th {
  position: sticky;
  top: 0;
  background: var(--surface-2);
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

td:nth-child(4) {
  white-space: normal;
  min-width: 220px;
}

.num {
  text-align: right;
    font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}

tbody tr:hover {
  background: #1b2420;
}

@media (max-width: 720px) {
  .header {
    flex-direction: column;
  }

  .stats {
    grid-template-columns: 1fr 1fr;
  }

  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }
}
