:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-alt: #eef3ff;
  --text: #152033;
  --muted: #5f6b7c;
  --border: #d8e0ee;
  --primary: #ffcc00;
  --primary-dark: #d6a900;
  --primary-light: #fff4c7;
  --success: #eaf7ee;
  --success-text: #1e7a3e;
  --error: #fff0f1;
  --error-text: #b4232c;
  --shadow: 0 10px 28px rgba(17, 33, 61, 0.08);
  --radius: 18px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  background: linear-gradient(180deg, #f7f9fd 0%, #eef4fb 100%);
  color: var(--text);
}
.page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 40px 20px 60px;
}
.hero {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 24px;
  align-items: stretch;
  margin-bottom: 24px;
}
.hero.compact { align-items: center; }
.eyebrow {
  display: inline-block;
  margin: 0 0 12px;
  color: var(--primary);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 12px;
}
h1 {
  margin: 0 0 12px;
  font-size: clamp(32px, 5vw, 52px);
  line-height: 1.03;
}
.lead {
  margin: 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.6;
  max-width: 58ch;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.steps {
  padding: 22px;
  display: grid;
  gap: 14px;
}
.step {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border-radius: 14px;
  background: var(--surface-alt);
}
.step span {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--primary);
  color: white;
  font-weight: 800;
}
.step p { margin: 0; font-weight: 600; }
.upload-card, .table-card { padding: 24px; }
.dropzone {
  display: block;
  border: 2px dashed #b9c9ea;
  border-radius: 18px;
  background: linear-gradient(180deg, #fbfdff 0%, #f3f7ff 100%);
  padding: 36px 24px;
  cursor: pointer;
  transition: all .18s ease;
}
.dropzone.dragover, .dropzone:hover {
  border-color: var(--primary);
  background: #edf4ff;
  transform: translateY(-1px);
}
.dropzone input { display: none; }
.drop-content { text-align: center; }
.icon { font-size: 42px; margin-bottom: 8px; }
.drop-content h2 { margin: 0 0 8px; font-size: 28px; }
.drop-content p { margin: 0 0 6px; color: var(--muted); }
.drop-content small { color: var(--muted); }
.file-row {
  margin: 14px 0 18px;
  padding: 14px 16px;
  border-radius: 12px;
  background: #f6f8fc;
  border: 1px solid var(--border);
  color: var(--muted);
}
.primary-btn, .secondary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 700;
  border: 0;
}
.primary-btn {
  background: var(--primary);
  color: white;
}
.primary-btn:hover { background: var(--primary-dark); }
.secondary-btn {
  background: white;
  color: var(--text);
  border: 1px solid var(--border);
}
.alert {
  padding: 14px 16px;
  border-radius: 14px;
  margin-bottom: 18px;
  font-weight: 600;
}
.alert.error { background: var(--error); color: var(--error-text); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: flex-end; align-items: center; }
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-bottom: 20px;
}
.stat {
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.stat span { color: var(--muted); font-weight: 600; }
.stat strong { font-size: 34px; }
.table-card h2 { margin: 0 0 18px; }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; min-width: 920px; }
thead th {
  background: #132845;
  color: white;
  text-align: left;
  padding: 14px;
  font-size: 14px;
}
tbody td {
  padding: 14px;
  border-bottom: 1px solid #e8edf5;
  vertical-align: top;
}
.note-row td {
  background: #fff8e8;
  color: #7a5a00;
  font-size: 14px;
}
@media (max-width: 920px) {
  .hero, .stats-grid { grid-template-columns: 1fr; }
  .hero-actions { justify-content: flex-start; }
}

.loading-state {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px solid #ffe680;
  border-radius: 12px;
  background: #fff9db;
  color: #5f4b00;
  font-weight: 600;
}

.loading-spinner {
  width: 18px;
  height: 18px;
  border: 3px solid rgba(95, 75, 0, 0.2);
  border-top-color: #ffcc00;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

[hidden] {
  display: none !important;
}