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

:root {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.4;
}

body {
  margin: 0;
  background: #050816;
  color: #f5f5f5;
}

.app {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem;
}

.app-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.app-header h1 {
  margin-bottom: 0.5rem;
  font-size: clamp(1.8rem, 3vw, 2.4rem);
}

.app-header p {
  color: #b0b3c0;
  max-width: 640px;
  margin: 0.25rem auto 0;
}

.app-main {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.5fr);
  gap: 1.5rem;
}

.panel {
  background: radial-gradient(circle at top left, #1f2933, #020617);
  border-radius: 1rem;
  padding: 1.25rem 1.5rem;
  box-shadow: 0 18px 35px rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(148, 163, 184, 0.18);
}

.panel h2 {
  margin-top: 0;
  font-size: 1.2rem;
}

/* Form */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.85rem 1rem;
  margin-bottom: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.form-group label {
  font-size: 0.9rem;
  font-weight: 500;
}

.form-group input[type="number"] {
  padding: 0.45rem 0.5rem;
  border-radius: 0.5rem;
  border: 1px solid #4b5563;
  background: rgba(15, 23, 42, 0.85);
  color: #f9fafb;
}

.form-group input[type="number"]:focus {
  outline: none;
  border-color: #38bdf8;
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.4);
}

.form-group small {
  font-size: 0.75rem;
  color: #9ca3af;
}

.inline {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.inline input[type="number"] {
  flex: 1;
}

/* Button */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1.2rem;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, #38bdf8, #6366f1);
  color: #020617;
  font-weight: 600;
  font-size: 0.95rem;
  margin-top: 0.5rem;
  transition: transform 0.08s ease, box-shadow 0.08s ease, filter 0.08s ease;
}

.btn-primary:hover {
  filter: brightness(1.05);
  box-shadow: 0 12px 25px rgba(59, 130, 246, 0.4);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 6px 16px rgba(59, 130, 246, 0.35);
}

/* Warnings */
.warnings {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: #facc15;
}

/* Summary */
.summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.summary-item {
  padding: 0.75rem;
  border-radius: 0.75rem;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.3);
}

.summary-item h3 {
  margin: 0 0 0.25rem;
  font-size: 0.9rem;
  color: #e5e7eb;
}

.summary-item p {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 500;
}

/* Chart */
.chart-container {
  background: rgba(15, 23, 42, 0.9);
  border-radius: 0.75rem;
  padding: 0.75rem;
  border: 1px solid rgba(148, 163, 184, 0.3);
  margin-bottom: 1rem;
}

/* Table */
.table-container {
  max-height: 260px;
  overflow: auto;
  border-radius: 0.75rem;
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: rgba(15, 23, 42, 0.9);
}

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.82rem;
}

thead {
  position: sticky;
  top: 0;
  background: rgba(15, 23, 42, 1);
}

th,
td {
  padding: 0.4rem 0.55rem;
  text-align: right;
}

th:first-child,
td:first-child {
  text-align: left;
}

th {
  font-weight: 600;
  color: #e5e7eb;
}

tbody tr:nth-child(even) {
  background: rgba(15, 23, 42, 0.8);
}

tbody tr:hover {
  background: rgba(30, 64, 175, 0.55);
}

/* Footer */
.app-footer {
  margin-top: 1.5rem;
  text-align: center;
  font-size: 0.8rem;
  color: #9ca3af;
}

/* Responsive */
@media (max-width: 840px) {
  .app-main {
    grid-template-columns: minmax(0, 1fr);
  }
}
