:root {
  --bg-0: #020617;
  --bg-1: #0f172a;
  --card: rgba(15, 23, 42, 0.88);
  --card-soft: rgba(30, 41, 59, 0.72);
  --border: rgba(148, 163, 184, 0.22);
  --border-strong: rgba(148, 163, 184, 0.36);
  --text: #e5e7eb;
  --muted: #94a3b8;
  --heading: #f8fafc;
  --accent: #f97316;
  --accent-soft: rgba(249, 115, 22, 0.16);
  --blue: #38bdf8;
  --green: #22c55e;
  --danger: #ef4444;
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.36);
}

* {
  box-sizing: border-box;
}

body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(56, 189, 248, 0.18), transparent 34rem),
    radial-gradient(circle at top right, rgba(249, 115, 22, 0.16), transparent 30rem),
    linear-gradient(135deg, var(--bg-0) 0%, var(--bg-1) 56%, #111827 100%);
  color: var(--text);
  margin: 0;
  padding: 30px;
  min-height: 100vh;
}

.app {
  max-width: 1180px;
  margin: 0 auto;
}

h1 {
  text-align: center;
  margin: 10px 0 28px;
  color: var(--heading);
  font-size: clamp(2.1rem, 5vw, 4rem);
  line-height: 1;
  letter-spacing: -0.055em;
  text-shadow: 0 0 42px rgba(56, 189, 248, 0.18);
}

h2 {
  color: var(--heading);
  margin: 0 0 18px;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

.card {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.92), rgba(15, 23, 42, 0.76));
  padding: 22px;
  margin: 22px auto;
  border-radius: 22px;
  max-width: 1160px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  backdrop-filter: blur(14px);
}

.inputs-card {
  border-top: 1px solid rgba(56, 189, 248, 0.28);
}

.input-grid,
.input-section {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.full-width {
  grid-column: 1 / -1;
}

.hidden {
  display: none;
}

label {
  font-weight: 700;
  font-size: 0.88rem;
  color: #cbd5e1;
}

input,
select {
  width: 100%;
  padding: 11px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(2, 6, 23, 0.54);
  color: var(--heading);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

input:focus,
select:focus {
  border-color: rgba(56, 189, 248, 0.75);
  box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.14);
  background: rgba(2, 6, 23, 0.78);
}

select option {
  background: #0f172a;
  color: var(--heading);
}

.button-group {
  justify-content: end;
}

button {
  padding: 12px 16px;
  font-weight: 800;
  cursor: pointer;
  border: 0;
  border-radius: 14px;
  color: #111827;
  background: linear-gradient(135deg, #fb923c, var(--accent));
  box-shadow: 0 12px 28px rgba(249, 115, 22, 0.25);
  transition: transform 0.15s ease, filter 0.15s ease, box-shadow 0.15s ease;
}

button:hover {
  transform: translateY(-1px);
  filter: brightness(1.04);
  box-shadow: 0 16px 34px rgba(249, 115, 22, 0.32);
}

button:active {
  transform: translateY(0);
}

.note {
  font-weight: 700;
  color: #bae6fd;
  margin-top: 0;
}

.chart-section {
  padding: 24px;
}

.chart-section h2 {
  margin-bottom: 16px;
}

.chart-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 245px;
  gap: 20px;
  align-items: stretch;
}

.chart-main {
  min-height: 520px;
  background:
    radial-gradient(circle at top, rgba(56, 189, 248, 0.08), transparent 24rem),
    #020617;
  border-radius: 20px;
  padding: 16px;
  box-shadow:
    inset 0 0 0 1px rgba(148, 163, 184, 0.18),
    inset 0 -50px 90px rgba(15, 23, 42, 0.58);
}

.chart-controls {
  background: linear-gradient(180deg, rgba(2, 6, 23, 0.82), rgba(15, 23, 42, 0.88));
  color: #e2e8f0;
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  padding: 17px;
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.24);
}

.chart-controls h3 {
  margin: 0 0 11px;
  color: var(--heading);
  font-size: 0.98rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.chart-controls hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 17px 0;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 10px 0;
  font-weight: 600;
  color: #cbd5e1;
}

.checkbox-row input {
  width: auto;
  accent-color: var(--accent);
}

.control-note {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0;
  line-height: 1.45;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 13px;
}

.summary-grid div {
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.86), rgba(15, 23, 42, 0.62));
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--border);
  color: #dbeafe;
}

.summary-grid strong {
  color: var(--heading);
}

.table-section {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 920px;
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
}

th {
  background: rgba(2, 6, 23, 0.92);
  color: #f8fafc;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

td,
th {
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
  padding: 10px 9px;
  text-align: center;
}

td {
  color: #cbd5e1;
  background: rgba(15, 23, 42, 0.46);
}

tbody tr:nth-child(even) td {
  background: rgba(30, 41, 59, 0.42);
}

tbody tr:hover td {
  background: rgba(56, 189, 248, 0.10);
}

.zero-row td {
  background: rgba(249, 115, 22, 0.18) !important;
  color: #fed7aa;
  font-weight: 800;
}

.notes-section .static-text {
  width: 100%;
  padding: 16px;
  font-family: inherit;
  background: rgba(2, 6, 23, 0.46);
  border: 1px solid var(--border);
  border-radius: 16px;
  min-height: 18em;
  white-space: pre-wrap;
  overflow: auto;
  color: #cbd5e1;
  line-height: 1.48;
}

.notes-section textarea {
  width: 100%;
  padding: 12px;
  resize: vertical;
  font-family: inherit;
}

@media (max-width: 800px) {
  body {
    padding: 16px;
  }

  .card {
    padding: 17px;
    border-radius: 18px;
  }

  .chart-layout {
    grid-template-columns: 1fr;
  }

  .chart-main {
    min-height: 380px;
  }
}
