/* ─── RESET & TOKENS ───────────────────────────────────────── */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --fg: #0f1117;
  --fg-muted: #5a5e6b;
  --fg-light: #8b8f9e;
  --bg: #fafbfc;
  --bg-card: #ffffff;
  --accent: #1a6b4a;
  --accent-light: #e8f5ee;
  --accent-dark: #124d35;
  --border: #e2e5ea;
  --amber: #b8860b;
  --amber-light: #fef9e7;
  --red: #c0392b;
  --red-light: #fdeaea;
  --green: #1a6b4a;
  --green-light: #e8f5ee;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-lg: 0 4px 12px rgba(0,0,0,0.08);
}

body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--fg);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: 'Space Grotesk', sans-serif;
  line-height: 1.2;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-dark); }

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ─── NAV ──────────────────────────────────────────────────── */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(250, 251, 252, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

.logo {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 18px;
  color: var(--fg);
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.logo-icon {
  width: 28px;
  height: 28px;
  background: var(--accent);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-links a {
  font-size: 14px;
  font-weight: 500;
  color: var(--fg-muted);
}
.nav-links a:hover { color: var(--fg); }

/* ─── BUTTONS ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  font-size: 14px;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s ease;
  padding: 10px 20px;
  text-decoration: none;
}

.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-lg { padding: 14px 28px; font-size: 16px; }

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

.btn-outline {
  background: transparent;
  color: var(--fg);
  border: 1px solid var(--border);
}
.btn-outline:hover {
  background: var(--bg-card);
  border-color: var(--fg-light);
  color: var(--fg);
}

/* ─── HERO ─────────────────────────────────────────────────── */
.hero {
  padding: 140px 24px 80px;
  text-align: center;
}

.hero-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  background: var(--accent-light);
  padding: 4px 14px;
  border-radius: 20px;
  margin-bottom: 20px;
}

.hero h1 {
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 700;
  color: var(--fg);
  margin-bottom: 16px;
}

.hero-sub {
  font-size: 18px;
  color: var(--fg-muted);
  max-width: 540px;
  margin: 0 auto 32px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.hero-trust {
  display: flex;
  gap: 24px;
  justify-content: center;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--fg-light);
}

.hero-trust span {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ─── SECTIONS ─────────────────────────────────────────────── */
.section {
  padding: 80px 24px;
}

.section-alt {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section h2 {
  font-size: 28px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 8px;
}

.section-sub {
  text-align: center;
  color: var(--fg-muted);
  margin-bottom: 40px;
}

/* ─── HOW IT WORKS ─────────────────────────────────────────── */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.step-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  text-align: center;
}

.step-num {
  width: 36px;
  height: 36px;
  background: var(--accent-light);
  color: var(--accent);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 16px;
  margin-bottom: 16px;
}

.step-card h3 {
  font-size: 18px;
  margin-bottom: 8px;
}

.step-card p {
  font-size: 14px;
  color: var(--fg-muted);
  line-height: 1.7;
}

/* ─── UPLOAD ───────────────────────────────────────────────── */
.upload-area {
  max-width: 600px;
  margin: 0 auto 32px;
  padding: 48px 32px;
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  background: var(--bg);
}

.upload-area:hover,
.upload-area.dragover {
  border-color: var(--accent);
  background: var(--accent-light);
}

.upload-area.dragover {
  transform: scale(1.01);
}

.upload-icon {
  color: var(--fg-light);
  margin-bottom: 12px;
}

.upload-area:hover .upload-icon,
.upload-area.dragover .upload-icon {
  color: var(--accent);
}

.upload-text {
  font-size: 16px;
  color: var(--fg);
  margin-bottom: 4px;
}

.upload-hint {
  font-size: 13px;
  color: var(--fg-light);
}

/* Processing state */
.upload-area.processing {
  border-color: var(--accent);
  background: var(--accent-light);
  pointer-events: none;
}

.processing-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--accent-light);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 0 auto 12px;
}

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

/* Column reference */
.columns-ref {
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
}

.columns-ref h4 {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg-light);
  margin-bottom: 10px;
}

.col-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 8px;
}

.col-tag {
  font-size: 12px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 4px;
}

.col-tag.required {
  background: var(--accent-light);
  color: var(--accent-dark);
}

.col-tag.optional {
  background: #f3f4f6;
  color: var(--fg-muted);
}

.col-hint {
  font-size: 12px;
  color: var(--fg-light);
}

/* ─── ERRORS ───────────────────────────────────────────────── */
.error-card {
  max-width: 700px;
  margin: 0 auto;
  background: var(--red-light);
  border: 1px solid #e8b4b4;
  border-radius: var(--radius-lg);
  padding: 24px;
}

.error-header {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--red);
  margin-bottom: 12px;
}

.error-header h3 {
  font-size: 16px;
  color: var(--red);
}

#errorList {
  list-style: none;
  padding: 0;
}

#errorList li {
  font-size: 14px;
  color: #7a2020;
  padding: 6px 0;
  border-bottom: 1px solid #e8b4b4;
}

#errorList li:last-child {
  border-bottom: none;
}

/* ─── STATS BAR ────────────────────────────────────────────── */
.stats-bar {
  display: flex;
  gap: 4px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 4px;
  margin-bottom: 24px;
  overflow-x: auto;
}

.stat {
  flex: 1;
  text-align: center;
  padding: 16px 12px;
  border-radius: var(--radius);
  min-width: 100px;
}

.stat-value {
  display: block;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--fg);
  line-height: 1;
  margin-bottom: 4px;
}

.stat-label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--fg-light);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stat-move {
  background: var(--red-light);
}
.stat-move .stat-value { color: var(--red); }

.stat-watch {
  background: var(--amber-light);
}
.stat-watch .stat-value { color: var(--amber); }

/* ─── ACTION BAR ───────────────────────────────────────────── */
.action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.action-bar h2 {
  font-size: 22px;
  text-align: left;
  margin-bottom: 0;
}

.action-bar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.filter-btn {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  padding: 6px 14px;
  border: none;
  background: transparent;
  color: var(--fg-muted);
  cursor: pointer;
  transition: all 0.15s;
}

.filter-btn:not(:last-child) {
  border-right: 1px solid var(--border);
}

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

.filter-btn:hover:not(.active) {
  background: var(--accent-light);
  color: var(--accent);
}

/* ─── TABLE ────────────────────────────────────────────────── */
.table-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

thead {
  background: #f8f9fa;
  border-bottom: 2px solid var(--border);
}

th {
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--fg-muted);
  white-space: nowrap;
  user-select: none;
}

th.sortable {
  cursor: pointer;
}

th.sortable:hover {
  color: var(--accent);
}

th.sortable::after {
  content: ' ↕';
  font-size: 10px;
  opacity: 0.4;
}

th.sort-asc::after { content: ' ↑'; opacity: 1; color: var(--accent); }
th.sort-desc::after { content: ' ↓'; opacity: 1; color: var(--accent); }

td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--fg);
}

tr:last-child td {
  border-bottom: none;
}

tr:hover td {
  background: #f8f9fa;
}

/* Action badges */
.badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 4px;
  white-space: nowrap;
}

.badge-move {
  background: var(--red-light);
  color: var(--red);
}

.badge-watch {
  background: var(--amber-light);
  color: var(--amber);
}

/* Urgency indicator */
.urgency-bar {
  display: flex;
  align-items: center;
  gap: 6px;
}

.urgency-dots {
  display: flex;
  gap: 2px;
}

.urgency-dot {
  width: 4px;
  height: 14px;
  border-radius: 2px;
  background: #e2e5ea;
}

.urgency-dot.filled { background: var(--accent); }
.urgency-dot.high { background: var(--amber); }
.urgency-dot.critical { background: var(--red); }

.urgency-num {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 14px;
  min-width: 18px;
}

/* Warehouse display */
.wh-from, .wh-to {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.wh-name {
  font-weight: 500;
  white-space: nowrap;
}

.wh-role {
  font-size: 11px;
  color: var(--fg-light);
}

/* Explanation */
.explanation-cell {
  font-size: 13px;
  color: var(--fg-muted);
  max-width: 280px;
  line-height: 1.5;
}

.no-results {
  text-align: center;
  color: var(--fg-light);
  padding: 40px 0;
  font-size: 15px;
}

/* ─── FOOTER ───────────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--border);
  padding: 48px 24px;
  background: var(--bg-card);
}

.footer-inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.footer-brand p {
  font-size: 13px;
  color: var(--fg-light);
  margin-top: 8px;
  max-width: 280px;
}

.footer-links {
  display: flex;
  gap: 20px;
}

.footer-links a {
  font-size: 14px;
  color: var(--fg-muted);
}

/* ─── RESPONSIVE ───────────────────────────────────────────── */
@media (max-width: 768px) {
  .hero { padding: 120px 16px 60px; }
  .hero h1 { font-size: 28px; }
  .hero-sub { font-size: 16px; }
  .hero-trust { flex-direction: column; align-items: center; gap: 8px; }

  .section { padding: 48px 16px; }

  .stats-bar { flex-wrap: wrap; }
  .stat { min-width: 80px; padding: 12px 8px; }
  .stat-value { font-size: 22px; }

  .action-bar { flex-direction: column; align-items: flex-start; }
  .action-bar-right { width: 100%; justify-content: flex-start; }

  .table-wrap { font-size: 13px; }
  td, th { padding: 10px 12px; }

  .footer-inner { flex-direction: column; }
}

@media (max-width: 480px) {
  .nav-links a:not(.btn) { display: none; }
  .hero-actions { flex-direction: column; align-items: center; }
  .filter-group { width: 100%; }
  .filter-btn { flex: 1; text-align: center; }
}
