:root {
  --bg-1: #041610;
  --bg-2: #09271d;
  --panel: rgba(245, 255, 250, 0.92);
  --panel-strong: rgba(255, 255, 255, 0.97);
  --border: rgba(24, 117, 74, 0.18);
  --text: #133227;
  --muted: #5c766d;
  --green-1: #0f9f66;
  --green-2: #22c17d;
  --green-3: #9df1c8;
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.18);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(62, 199, 133, 0.24), transparent 26%),
    radial-gradient(circle at bottom right, rgba(34, 193, 125, 0.18), transparent 28%),
    linear-gradient(145deg, var(--bg-1), var(--bg-2));
  position: relative;
  overflow-x: hidden;
}

body.is-uploading {
  overflow: hidden;
}

.data-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.data-bg__orb,
.data-bg__stream,
.data-bg__grid {
  position: absolute;
}

.data-bg__orb {
  border-radius: 50%;
  filter: blur(12px);
  opacity: 0.28;
}

.data-bg__orb--one {
  width: 320px;
  height: 320px;
  top: -60px;
  right: -60px;
  background: radial-gradient(circle, rgba(84, 255, 176, 0.95), transparent 68%);
  animation: floatOrb 18s ease-in-out infinite;
}

.data-bg__orb--two {
  width: 280px;
  height: 280px;
  bottom: 5%;
  left: -90px;
  background: radial-gradient(circle, rgba(20, 173, 110, 0.9), transparent 70%);
  animation: floatOrb 20s ease-in-out infinite reverse;
}

.data-bg__stream {
  width: 160%;
  height: 2px;
  left: -30%;
  background: linear-gradient(90deg, transparent, rgba(159, 255, 209, 0.8), transparent);
  opacity: 0.4;
}

.data-bg__stream--one {
  top: 24%;
  transform: rotate(-12deg);
  animation: drift 14s linear infinite;
}

.data-bg__stream--two {
  top: 68%;
  transform: rotate(9deg);
  animation: drift 17s linear infinite reverse;
}

.data-bg__grid {
  inset: 0;
  background-image:
    linear-gradient(rgba(157, 241, 200, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(157, 241, 200, 0.06) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.95) 20%, rgba(0, 0, 0, 0.95) 80%, transparent);
}

.hero,
#dashboardRoot,
.app-footer {
  position: relative;
  z-index: 1;
}

.hero {
  padding-top: 1rem;
}

.hero-shell {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  align-items: flex-start;
  padding: 1.5rem 1.75rem;
  border-radius: 28px;
  border: 1px solid rgba(157, 241, 200, 0.18);
  background: linear-gradient(135deg, rgba(250, 255, 252, 0.12), rgba(255, 255, 255, 0.05));
  backdrop-filter: blur(12px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.16);
}

.hero-title {
  font-size: clamp(2rem, 5vw, 3.6rem);
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: #f5fff9;
}

.app-logo {
  width: min(100%, 360px);
  height: auto;
  display: block;
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.18));
}

.hero-subtitle,
.hero-chip,
.hero-badge {
  color: rgba(236, 255, 245, 0.88);
}

.hero-subtitle {
  max-width: 780px;
  font-size: 1rem;
}

.hero-badge {
  display: inline-flex;
  margin-bottom: 0.9rem;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  background: rgba(157, 241, 200, 0.14);
  border: 1px solid rgba(157, 241, 200, 0.2);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.hero-meta {
  min-width: 220px;
  display: grid;
  gap: 0.9rem;
}

.hero-chip {
  padding: 1rem 1.1rem;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(157, 241, 200, 0.14);
}

.hero-chip__label {
  display: block;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.74;
  margin-bottom: 0.2rem;
}

.card {
  border: 1px solid var(--border);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.shell-card,
.shell-card .card-header {
  border-radius: 24px;
}

.shell-card .card-header {
  background: rgba(17, 141, 88, 0.06);
  border-bottom: 1px solid rgba(24, 117, 74, 0.1);
  font-weight: 700;
  color: #164735;
}

.shell-card--hero {
  background: linear-gradient(180deg, rgba(244, 255, 249, 0.95), rgba(235, 253, 243, 0.92));
}

.shell-card--empty {
  background: linear-gradient(180deg, rgba(244, 255, 249, 0.95), rgba(255, 255, 255, 0.92));
}

.section-kicker {
  color: var(--green-1);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 0.7rem;
}

.section-title {
  font-size: clamp(1.7rem, 4vw, 2.8rem);
  line-height: 1.02;
  margin-bottom: 0.9rem;
  font-weight: 800;
  color: #103627;
}

.section-text {
  color: var(--muted);
  font-size: 1rem;
  max-width: 700px;
}

.feature-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1.25rem;
}

.feature-pill {
  padding: 0.55rem 0.85rem;
  border-radius: 999px;
  background: rgba(15, 159, 102, 0.08);
  border: 1px solid rgba(15, 159, 102, 0.15);
  font-size: 0.92rem;
  font-weight: 600;
  color: #17553f;
}

.upload-panel {
  padding: 1.3rem;
  border-radius: 24px;
  background: var(--panel-strong);
  border: 1px solid rgba(15, 159, 102, 0.14);
  box-shadow: 0 16px 40px rgba(18, 69, 46, 0.14);
}

.upload-panel__head {
  margin-bottom: 1rem;
}

.upload-hint {
  margin-top: 0.85rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.form-control,
.form-select {
  border-radius: 16px;
  border-color: rgba(15, 159, 102, 0.18);
  padding: 0.9rem 1rem;
}

.form-control:focus,
.form-select:focus {
  border-color: rgba(15, 159, 102, 0.45);
  box-shadow: 0 0 0 0.25rem rgba(34, 193, 125, 0.15);
}

.btn-primary {
  background: linear-gradient(135deg, var(--green-1), var(--green-2));
  border: 0;
  border-radius: 16px;
  box-shadow: 0 14px 28px rgba(15, 159, 102, 0.28);
}

.btn-primary:hover,
.btn-primary:focus {
  background: linear-gradient(135deg, #0b8f5b, #1daa6f);
}

.btn-outline-primary {
  color: var(--green-1);
  border-color: rgba(15, 159, 102, 0.32);
  border-radius: 14px;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
  background: rgba(15, 159, 102, 0.08);
  color: #0d774c;
  border-color: rgba(15, 159, 102, 0.4);
}

.btn-outline-secondary {
  border-radius: 14px;
}

.info-card {
  border-radius: 22px;
  background: rgba(250, 255, 252, 0.92);
}

.info-card__icon {
  width: 52px;
  height: 52px;
  display: inline-grid;
  place-items: center;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(15, 159, 102, 0.16), rgba(34, 193, 125, 0.1));
  color: var(--green-1);
  font-weight: 800;
  margin-bottom: 1rem;
}

.preview-board {
  padding: 1.25rem;
  border-radius: 22px;
  background: linear-gradient(180deg, #0d2a20, #10392b);
  min-height: 280px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.preview-board__line {
  height: 12px;
  width: 72%;
  border-radius: 999px;
  background: rgba(157, 241, 200, 0.88);
  margin-bottom: 0.8rem;
}

.preview-board__line--short {
  width: 48%;
  opacity: 0.7;
}

.preview-board__chart {
  margin-top: 1.6rem;
  height: 110px;
  display: flex;
  align-items: end;
  gap: 0.65rem;
}

.preview-board__chart span {
  flex: 1;
  border-radius: 12px 12px 4px 4px;
  background: linear-gradient(180deg, #76f0b7, #21b876);
  animation: pulseBars 2.8s ease-in-out infinite;
}

.preview-board__chart span:nth-child(1) { height: 42%; }
.preview-board__chart span:nth-child(2) { height: 76%; animation-delay: 0.2s; }
.preview-board__chart span:nth-child(3) { height: 58%; animation-delay: 0.4s; }
.preview-board__chart span:nth-child(4) { height: 88%; animation-delay: 0.6s; }

.preview-board__table {
  margin-top: 1.25rem;
  height: 52px;
  border-radius: 16px;
  background:
    linear-gradient(rgba(157, 241, 200, 0.18), rgba(157, 241, 200, 0.18)) 0 0 / 100% 2px no-repeat,
    repeating-linear-gradient(to bottom, rgba(255, 255, 255, 0.08) 0 8px, transparent 8px 16px),
    repeating-linear-gradient(to right, rgba(255, 255, 255, 0.08) 0 25%, transparent 25% 26%);
}

.stat-card {
  border: 0;
  border-radius: 22px;
  box-shadow: 0 16px 38px rgba(13, 57, 39, 0.12);
  background: linear-gradient(180deg, rgba(253, 255, 254, 0.97), rgba(235, 252, 243, 0.94));
}

.stat-card h3 {
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  font-weight: 800;
  color: #145139;
}

.alert {
  border-radius: 18px;
  border: 0;
}

.table {
  --bs-table-bg: transparent;
  margin-bottom: 0;
}

.table thead th {
  white-space: nowrap;
  font-size: 0.85rem;
  color: #356150;
}

.table tbody td {
  white-space: nowrap;
  vertical-align: middle;
}

canvas {
  max-height: 340px;
}

#aiInsightOutput {
  white-space: pre-wrap;
  min-height: 72px;
  padding: 1rem;
  border-radius: 18px;
  background: rgba(15, 159, 102, 0.05);
  border: 1px solid rgba(15, 159, 102, 0.1);
}

.upload-overlay {
  position: fixed;
  inset: 0;
  z-index: 1055;
  display: grid;
  place-items: center;
  background: rgba(2, 18, 12, 0.6);
  backdrop-filter: blur(4px);
}

.upload-overlay__card {
  width: min(92vw, 540px);
  background: var(--panel-strong);
  border-radius: 22px;
  padding: 1.4rem;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
  animation: riseIn 0.28s ease-out;
}

.progress {
  border-radius: 999px;
  background: rgba(15, 159, 102, 0.09);
}

.progress-bar {
  background: linear-gradient(90deg, var(--green-1), var(--green-2));
}

.ux-fade-up {
  opacity: 0;
  transform: translateY(10px);
  animation: fadeUp 0.45s ease-out forwards;
}

.app-footer {
  padding: 1.3rem 0 2rem;
  color: rgba(240, 255, 246, 0.82);
  text-align: center;
}

.app-footer p:first-child {
  font-weight: 700;
  letter-spacing: 0.04em;
}

@keyframes fadeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@keyframes floatOrb {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(24px, -18px, 0); }
}

@keyframes drift {
  from { transform: translateX(-4%) rotate(-12deg); }
  to { transform: translateX(4%) rotate(-12deg); }
}

@keyframes pulseBars {
  0%, 100% { transform: scaleY(1); opacity: 0.82; }
  50% { transform: scaleY(1.08); opacity: 1; }
}

@media (max-width: 991.98px) {
  .hero-shell {
    flex-direction: column;
  }

  .hero-meta {
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 767.98px) {
  .app-logo {
    width: min(100%, 280px);
  }

  .hero-shell {
    padding: 1.2rem;
    border-radius: 22px;
  }

  .hero-meta {
    grid-template-columns: 1fr;
  }

  .section-title {
    font-size: 1.7rem;
  }

  .upload-panel,
  .preview-board {
    min-height: auto;
  }

  .card-header {
    gap: 0.75rem;
  }

  .form-select.form-select-sm.w-auto {
    width: 100% !important;
  }

  .app-footer {
    padding-bottom: 2.4rem;
  }
}
