:root {
  --bg: #edf3f1;
  --panel: rgba(255, 255, 255, 0.86);
  --line: rgba(18, 43, 37, 0.1);
  --text: #132622;
  --muted: #64766f;
  --accent: #0f766e;
  --accent-strong: #115e59;
  --accent-soft: #d6f3ed;
  --danger: #dc2626;
  --shadow: 0 18px 45px rgba(22, 52, 45, 0.1);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Aptos", "Segoe UI Variable Text", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(15, 118, 110, 0.18), transparent 28%),
    radial-gradient(circle at top right, rgba(245, 158, 11, 0.14), transparent 20%),
    linear-gradient(180deg, #f4f7f6 0%, var(--bg) 100%);
  color: var(--text);
}

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 320px 1fr;
}

.sidebar {
  padding: 28px;
  background: rgba(14, 28, 25, 0.94);
  color: #f7fbfa;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 24px;
}

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

.brand-badge {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: linear-gradient(135deg, #0f766e, #22c55e);
  display: grid;
  place-items: center;
  font-weight: 800;
}

.eyebrow {
  margin: 0 0 6px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--muted);
}

.sidebar .eyebrow { color: rgba(226, 240, 236, 0.7); }
.brand h1, .hero-card h2, .panel h3 { margin: 0; }

.sidebar-copy,
.hero-copy,
.upload-subtitle {
  margin: 0;
  line-height: 1.6;
  color: var(--muted);
}

.sidebar-copy, .upload-subtitle { color: rgba(226, 240, 236, 0.72); }

.upload-panel,
.download-panel {
  padding: 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  backdrop-filter: blur(14px);
}

.upload-dropzone {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 22px 18px;
  border-radius: 18px;
  border: 1px dashed rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
}

.upload-dropzone input { display: none; }
.upload-title { font-size: 18px; font-weight: 700; }

.upload-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}

.btn,
.chart-save {
  border: none;
  border-radius: 14px;
  padding: 12px 14px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.18s ease, opacity 0.18s ease, background 0.18s ease;
}

.btn:hover, .chart-save:hover { transform: translateY(-1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

.btn-primary {
  background: linear-gradient(135deg, #13b8a6, #0f766e);
  color: white;
}

.btn-secondary,
.chart-save {
  background: rgba(15, 118, 110, 0.1);
  color: var(--accent-strong);
}

.sidebar .btn-secondary { background: rgba(255, 255, 255, 0.1); color: white; }

.download-panel h2 { margin: 0 0 12px; font-size: 18px; }
.download-panel { display: grid; gap: 10px; }

.file-list { margin-top: 14px; display: grid; gap: 8px; }

.file-chip {
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 13px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.88);
}

.main { padding: 28px; display: grid; gap: 22px; }

.hero-card,
.panel,
.summary-card {
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 28px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.hero-card {
  padding: 26px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
}

.status-pill {
  white-space: nowrap;
  padding: 11px 18px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 800;
}

.summary-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.summary-card { padding: 20px; }
.summary-label { font-size: 13px; color: var(--muted); }
.summary-value { margin-top: 10px; font-size: 30px; font-weight: 800; }
.summary-meta { margin-top: 8px; font-size: 13px; color: var(--muted); }

.content-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.panel { padding: 20px; }
.panel-wide { grid-column: span 2; }

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

canvas {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(240, 247, 245, 0.92));
}

.insight-list { display: grid; gap: 12px; }

.insight-list.empty {
  color: var(--muted);
  min-height: 220px;
  place-content: center;
}

.insight-item {
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(15, 118, 110, 0.08);
  line-height: 1.6;
}

.table-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 18px;
}

.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; }

th, td {
  padding: 12px 10px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}

th { color: var(--muted); font-weight: 700; }

@media (max-width: 1180px) {
  .shell { grid-template-columns: 1fr; }
  .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .content-grid, .table-grid { grid-template-columns: 1fr; }
  .panel-wide { grid-column: span 1; }
}

@media (max-width: 720px) {
  .main, .sidebar { padding: 18px; }
  .summary-grid { grid-template-columns: 1fr; }
  .hero-card { flex-direction: column; align-items: flex-start; }
  .upload-actions { grid-template-columns: 1fr; }
}
