:root {
  --bg: #050505;
  --bg-elevated: #101010;
  --bg-elevated-soft: #161616;
  --accent: #1989fa;
  --accent-soft: rgba(25, 137, 250, 0.12);
  --accent-strong: #1989fa;
  --text: #f5f5f5;
  --text-muted: #a3a3a3;
  --border-subtle: rgba(163, 163, 163, 0.3);
  --radius-lg: 18px;
  --radius-full: 999px;
  --shadow-soft: 0 18px 32px rgba(0, 0, 0, 0.75);
  --shadow-subtle: 0 10px 24px rgba(0, 0, 0, 0.6);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
}

.app {
  max-width: 1120px;
  margin: 0 auto;
  padding: 28px 18px 40px;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-soft);
  margin-bottom: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-logo {
  width: 40px;
  height: 40px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #111;
  border: 1px solid var(--accent);
  box-shadow: 0 0 0 1px rgba(25, 137, 250, 0.3);
  font-size: 22px;
}

.brand-text h1 {
  font-size: 1.2rem;
  margin: 0 0 3px;
  letter-spacing: 0.02em;
}

.brand-text p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.app-main {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.card {
  border-radius: 24px;
  background: var(--bg-elevated-soft);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-subtle);
  padding: 18px 18px 16px;
}

.card h2 {
  font-size: 1.05rem;
  margin: 0 0 10px;
}

.hint {
  margin: 0 0 14px;
  font-size: 0.85rem;
}

.muted {
  color: var(--text-muted);
}

.upload-area {
  margin-top: 6px;
  border-radius: 20px;
  padding: 18px 16px;
  border: 1px dashed rgba(163, 163, 163, 0.7);
  background: #0b0b0b;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: border-color 0.18s ease, box-shadow 0.18s ease,
    transform 0.12s ease, background 0.2s ease;
}

.upload-area:hover {
  border-color: var(--accent);
  background: #111;
  box-shadow: 0 18px 35px rgba(0, 0, 0, 0.9),
    0 0 0 1px rgba(25, 137, 250, 0.25);
  transform: translateY(-1px);
}

.upload-area:active {
  transform: translateY(0);
  box-shadow: 0 12px 25px rgba(15, 23, 42, 0.7);
}

.upload-area input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.upload-icon {
  width: 40px;
  height: 40px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 600;
  font-size: 1.2rem;
}

.upload-text {
  font-size: 0.95rem;
}

.file-info {
  margin-top: 8px;
  font-size: 0.85rem;
}

.form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 10px;
}

.form-field {
  flex: 1 1 180px;
  min-width: 0;
}

.form-field label {
  display: block;
  font-size: 0.86rem;
  margin-bottom: 6px;
  color: var(--text-muted);
}

select {
  width: 100%;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  color: var(--text);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease,
    background 0.15s ease;
}

select:focus {
  border-color: var(--accent-strong);
  box-shadow: 0 0 0 1px rgba(25, 137, 250, 0.5);
  background: #060606;
}

.primary-btn,
.ghost-btn {
  border-radius: var(--radius-full);
  padding: 9px 16px;
  font-size: 0.9rem;
  font-weight: 500;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: transform 0.08s ease, box-shadow 0.12s ease,
    background 0.15s ease, color 0.15s ease;
}

.primary-btn {
  background: #1989fa;
  color: #ffffff;
  box-shadow: 0 12px 28px rgba(25, 137, 250, 0.6);
  margin-top: 4px;
}

.primary-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 32px rgba(25, 137, 250, 0.8);
}

.primary-btn:active {
  transform: translateY(0);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.8);
}

.ghost-btn {
  background: transparent;
  border: 1px solid rgba(163, 163, 163, 0.7);
  color: var(--text-muted);
  padding-inline: 12px;
}

.ghost-btn:hover {
  background: #111;
  color: var(--text);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.8);
}

.chart-card {
  padding-top: 16px;
}

.chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

#chart-canvas {
  width: 100%;
}

.app-footer {
  margin-top: 20px;
  font-size: 0.8rem;
  text-align: center;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
  font-size: 0.85rem;
}

.data-table thead {
  background: #111;
}

.data-table th,
.data-table td {
  border: 1px solid rgba(64, 64, 64, 0.9);
  padding: 6px 8px;
  text-align: left;
}

.data-table tbody tr:nth-child(odd) {
  background: #111;
}

.charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.chart-item {
  background: #101010;
  border-radius: 18px;
  border: 1px solid rgba(82, 82, 82, 0.9);
  padding: 10px 10px 6px;
}

.chart-item-title {
  font-size: 0.85rem;
  margin: 0 0 4px;
  color: var(--text-muted);
}

.chart-item-inner {
  width: 100%;
  height: 140px;
}

@media (max-width: 768px) {
  .app {
    padding-inline: 14px;
  }

  .app-header {
    padding-inline: 14px;
  }

  .card {
    padding-inline: 14px;
  }

  .brand-text h1 {
    font-size: 1.05rem;
  }
}

