:root {
  --bg: #08111f;
  --bg-soft: #0f1b2d;
  --surface: rgba(255, 255, 255, 0.05);
  --surface-strong: rgba(255, 255, 255, 0.08);
  --border: rgba(255, 255, 255, 0.08);
  --text: #eef2f7;
  --text-soft: #9fb0c6;
  --title: #ffffff;
  --accent: #f5a623;
  --accent-strong: #e58e0b;
  --success: #22c55e;
  --shadow: 0 24px 48px rgba(0, 0, 0, 0.28);
  --radius-xl: 26px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
}

body.light-theme {
  --bg: #edf3f9;
  --bg-soft: #ffffff;
  --surface: rgba(255, 255, 255, 0.9);
  --surface-strong: rgba(255, 255, 255, 1);
  --border: rgba(15, 23, 42, 0.08);
  --text: #243447;
  --text-soft: #607286;
  --title: #0f172a;
  --accent: #f59e0b;
  --accent-strong: #d97706;
  --shadow: 0 18px 36px rgba(15, 23, 42, 0.08);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Inter", sans-serif;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(245, 166, 35, 0.14), transparent 18%),
    radial-gradient(circle at top right, rgba(59, 130, 246, 0.10), transparent 16%),
    linear-gradient(135deg, var(--bg), #091524 55%, #122238);
  transition: background 0.25s ease, color 0.25s ease;
}

body.light-theme {
  background:
    radial-gradient(circle at top left, rgba(245, 166, 35, 0.10), transparent 18%),
    linear-gradient(135deg, #f3f7fb, #edf3f9 45%, #e5edf6);
}

button,
input {
  font: inherit;
}

svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.app-shell {
  display: grid;
  grid-template-columns: 320px 1fr;
  min-height: 100vh;
}

.sidebar {
  padding: 28px 22px;
  background: rgba(3, 9, 19, 0.72);
  border-right: 1px solid var(--border);
  backdrop-filter: blur(14px);
}

body.light-theme .sidebar {
  background: rgba(255, 255, 255, 0.72);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 26px;
}

.brand-mark {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #1b2430;
  box-shadow: var(--shadow);
}

.brand h1 {
  color: var(--title);
  font-size: 1.2rem;
  margin-bottom: 4px;
}

.brand p {
  color: var(--text-soft);
  font-size: 0.92rem;
}

.sidebar-card,
.panel,
.metric-card,
.scenario-card {
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.sidebar-card {
  border-radius: var(--radius-xl);
  padding: 20px;
  margin-bottom: 16px;
}

.accent-card {
  background: linear-gradient(155deg, rgba(245, 166, 35, 0.14), rgba(255, 255, 255, 0.04));
}

.sidebar-label,
.metric-label,
.scenario-label {
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--accent);
}

.sidebar-label {
  margin-bottom: 12px;
}

.sidebar-card h2 {
  color: var(--title);
  line-height: 1.35;
  margin-bottom: 10px;
  font-size: 1.06rem;
}

.sidebar-card p {
  color: var(--text-soft);
  line-height: 1.65;
  font-size: 0.95rem;
}

.feature-list {
  list-style: none;
  display: grid;
  gap: 10px;
}

.feature-list li {
  color: var(--text-soft);
  padding-left: 18px;
  position: relative;
  line-height: 1.45;
}

.feature-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--accent);
}

.main-content {
  padding: 30px;
}

.hero {
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  gap: 20px;
  margin-bottom: 24px;
  padding: 28px;
  border-radius: 30px;
  background: linear-gradient(135deg, rgba(255,255,255,0.07), rgba(255,255,255,0.03));
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

body.light-theme .hero {
  background: linear-gradient(135deg, rgba(255,255,255,0.94), rgba(255,255,255,0.82));
}

.hero-tag {
  display: inline-block;
  margin-bottom: 12px;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero h2 {
  color: var(--title);
  font-size: 2.15rem;
  line-height: 1.12;
  max-width: 760px;
  margin-bottom: 12px;
}

.hero p {
  color: var(--text-soft);
  line-height: 1.7;
  max-width: 760px;
}

.hero-actions {
  min-width: 210px;
  display: grid;
  gap: 10px;
  align-self: center;
}

.primary-btn,
.secondary-btn {
  border: none;
  border-radius: var(--radius-sm);
  padding: 13px 18px;
  cursor: pointer;
  font-weight: 700;
  transition: transform 0.2s ease, opacity 0.2s ease, background 0.2s ease;
}

.primary-btn {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #111827;
}

.secondary-btn {
  background: var(--surface-strong);
  color: var(--text);
  border: 1px solid var(--border);
}

.primary-btn:hover,
.secondary-btn:hover {
  transform: translateY(-2px);
}

.panel {
  border-radius: var(--radius-xl);
  padding: 24px;
}

.panel-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 18px;
}

.panel-heading h3 {
  color: var(--title);
  font-size: 1.12rem;
  margin-bottom: 8px;
}

.panel-heading p {
  color: var(--text-soft);
  line-height: 1.6;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group label {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--title);
  margin-bottom: 8px;
}

.form-group input {
  padding: 14px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
  outline: none;
  transition: border-color 0.2s ease, background 0.2s ease;
}

body.light-theme .form-group input {
  background: rgba(15, 23, 42, 0.04);
}

.form-group input::placeholder {
  color: #94a3b8;
}

.form-group input:focus {
  border-color: rgba(245, 166, 35, 0.55);
}

.validation-message {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: rgba(239, 68, 68, 0.12);
  color: #fecaca;
  border: 1px solid rgba(239, 68, 68, 0.24);
  line-height: 1.55;
}

body.light-theme .validation-message {
  color: #991b1b;
}

.hidden {
  display: none;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 24px 0;
}

.metric-card {
  border-radius: 24px;
  padding: 22px;
  position: relative;
  overflow: hidden;
}

.metric-card::after {
  content: "";
  position: absolute;
  inset: auto -20px -40px auto;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(245, 166, 35, 0.14), transparent 65%);
  pointer-events: none;
}

.metric-icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  margin-bottom: 16px;
  background: linear-gradient(135deg, rgba(245, 166, 35, 0.18), rgba(245, 166, 35, 0.08));
  color: var(--accent);
}

.metric-label {
  margin-bottom: 10px;
}

.metric-card h3 {
  color: var(--title);
  font-size: 1.7rem;
  margin-bottom: 8px;
}

.metric-card p {
  color: var(--text-soft);
  line-height: 1.55;
  font-size: 0.94rem;
}

.content-grid {
  display: grid;
  grid-template-columns: 1.25fr 0.95fr;
  gap: 16px;
}

.stack-column {
  display: grid;
  gap: 16px;
}

.chart-wrapper {
  position: relative;
  height: 330px;
}

.summary-box {
  padding: 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.05);
  border-left: 4px solid var(--accent);
  line-height: 1.8;
  color: var(--text);
}

body.light-theme .summary-box {
  background: rgba(15, 23, 42, 0.03);
}

.summary-box strong {
  color: var(--title);
}

.scenario-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.scenario-card {
  border-radius: 20px;
  padding: 18px;
}

.scenario-card h4 {
  color: var(--title);
  font-size: 1.5rem;
  margin: 12px 0 10px;
}

.scenario-card p {
  color: var(--text-soft);
  line-height: 1.55;
  font-size: 0.94rem;
}

.scenario-card.optimistic {
  background: linear-gradient(145deg, rgba(34, 197, 94, 0.12), rgba(255, 255, 255, 0.04));
}

@media (max-width: 1220px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .content-grid {
    grid-template-columns: 1fr;
  }

  .form-grid,
  .metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 820px) {
  .main-content {
    padding: 18px;
  }

  .hero,
  .panel-heading {
    flex-direction: column;
  }

  .hero-actions {
    min-width: unset;
    width: 100%;
  }

  .form-grid,
  .metrics-grid,
  .scenario-grid {
    grid-template-columns: 1fr;
  }

  .primary-btn,
  .secondary-btn {
    width: 100%;
  }

  .hero h2 {
    font-size: 1.7rem;
  }
}