:root {
  --ink: #f8fafc;
  --text: #dbe7ff;
  --muted: #97a8c7;
  --panel: rgba(12, 20, 37, 0.78);
  --panel-strong: rgba(9, 14, 26, 0.9);
  --edge: rgba(104, 132, 178, 0.36);
  --accent: #22d3ee;
  --accent-strong: #06b6d4;
  --warm: #ff7a59;
  --danger: #fb7185;
  --ok: #86efac;
}

* {
  box-sizing: border-box;
}

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

body {
  font-family: "IBM Plex Sans", sans-serif;
  color: var(--text);
  background: #050913;
  position: relative;
}

.bg-layer {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(1100px 500px at 12% -10%, rgba(34, 211, 238, 0.22), transparent 60%),
    radial-gradient(900px 520px at 105% 5%, rgba(255, 122, 89, 0.18), transparent 58%),
    linear-gradient(140deg, #070d18 0%, #050913 54%, #0a1222 100%);
}

.shell {
  width: min(1120px, 100% - 2rem);
  margin: 0 auto;
  padding: 1.25rem 0 2rem;
}

.hero {
  margin: 0.8rem 0 1.2rem;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.4rem 0.62rem;
  border-radius: 999px;
  color: var(--ink);
  border: 1px solid rgba(34, 211, 238, 0.5);
  background: rgba(34, 211, 238, 0.14);
}

.hero h1 {
  margin: 0.6rem 0 0.3rem;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(2rem, 4.8vw, 3.3rem);
  letter-spacing: -0.02em;
  color: #f6fbff;
}

.hero p {
  margin: 0;
  max-width: 64ch;
  color: var(--muted);
}

.panel {
  background: linear-gradient(175deg, rgba(18, 30, 54, 0.88), var(--panel-strong));
  border: 1px solid var(--edge);
  border-radius: 18px;
  padding: 1rem;
  box-shadow: 0 18px 44px rgba(2, 7, 17, 0.42);
  backdrop-filter: blur(8px);
}

.muted {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.93rem;
}

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

h2,
h3,
h4 {
  font-family: "Space Grotesk", sans-serif;
  margin: 0;
  color: #f3f7ff;
}

label {
  display: block;
  margin-bottom: 0.7rem;
  font-weight: 600;
}

input,
textarea,
button {
  width: 100%;
  font: inherit;
}

input,
textarea {
  margin-top: 0.32rem;
  border: 1px solid rgba(135, 167, 221, 0.45);
  background: rgba(5, 10, 21, 0.62);
  color: var(--ink);
  border-radius: 12px;
  padding: 0.62rem 0.72rem;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

input:focus,
textarea:focus {
  border-color: rgba(34, 211, 238, 0.95);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.14);
}

button {
  border: 0;
  border-radius: 12px;
  padding: 0.68rem 0.85rem;
  margin-top: 0.4rem;
  font-weight: 700;
  color: #02101a;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  cursor: pointer;
  transition: transform 150ms ease, filter 150ms ease;
}

button:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

button.secondary {
  width: auto;
  margin-top: 0;
  color: #fff;
  background: linear-gradient(135deg, #334155, #1f2937);
}

.uploader-grid,
.tables-grid,
.stats-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.stats-grid .stat {
  display: grid;
  gap: 0.35rem;
}

.stat-value {
  margin: 0;
  font-size: clamp(1.45rem, 3.3vw, 2.15rem);
  font-weight: 700;
  color: #f6fdff;
}

.status,
.error {
  min-height: 1.35rem;
  margin: 0.78rem 0 0.3rem;
}

.status {
  color: var(--ok);
}

.error {
  color: var(--danger);
}

table {
  width: 100%;
  margin-top: 0.7rem;
  border-collapse: collapse;
  font-size: 0.94rem;
}

th,
td {
  padding: 0.56rem;
  border-bottom: 1px solid rgba(145, 168, 206, 0.25);
  text-align: left;
  vertical-align: top;
}

th {
  color: #b9cdf2;
  font-weight: 600;
}

td {
  color: #e4eeff;
}

.hidden {
  display: none;
}

.reveal {
  animation: riseIn 420ms ease both;
}

.delay-1 {
  animation-delay: 60ms;
}

.delay-2 {
  animation-delay: 120ms;
}

.delay-3 {
  animation-delay: 180ms;
}

@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (min-width: 840px) {
  .uploader-grid,
  .tables-grid {
    grid-template-columns: 1fr 1fr;
  }

  .stats-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
