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

body {
  margin: 0;
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
  color: #1f2933;
  background: #f5f7fa;
  line-height: 1.5;
}

h1,
h2,
h3 {
  margin: 0 0 0.5rem;
}

p {
  margin: 0 0 1rem;
}

button,
input,
select,
textarea {
  font: inherit;
}

.app-header {
  padding: 1.5rem 2rem 1rem;
  background: #0f172a;
  color: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.subtitle {
  color: #cbd5f5;
  font-size: 0.95rem;
}

.nav-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tab-button {
  border: 1px solid transparent;
  background: #1e293b;
  color: #f8fafc;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  cursor: pointer;
  transition: 0.2s ease;
}

.tab-button:hover {
  background: #334155;
}

.tab-button.active {
  background: #38bdf8;
  color: #0f172a;
  font-weight: 600;
}

main {
  padding: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.app-section {
  display: none;
  flex-direction: column;
  gap: 1.5rem;
}

.app-section.active {
  display: flex;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.panel {
  background: #ffffff;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.grid {
  display: grid;
  gap: 1rem;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.9rem;
  color: #334155;
}

input,
select,
textarea {
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  border: 1px solid #cbd5f5;
  background: #f8fafc;
}

textarea {
  resize: vertical;
}

button {
  border: none;
  padding: 0.6rem 1.25rem;
  border-radius: 8px;
  cursor: pointer;
}

button.primary {
  background: #2563eb;
  color: #fff;
  font-weight: 600;
}

button.primary:hover {
  background: #1d4ed8;
}

button.ghost {
  background: transparent;
  border: 1px solid #94a3b8;
  color: #475569;
}

button.ghost:hover {
  border-color: #1e293b;
  color: #1e293b;
}

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

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

thead th {
  text-align: left;
  padding: 0.75rem 0.5rem;
  border-bottom: 2px solid #e2e8f0;
  color: #1f2933;
}

tbody td {
  padding: 0.65rem 0.5rem;
  border-bottom: 1px solid #e2e8f0;
}

tbody tr:nth-child(even) {
  background: #f8fafc;
}

.total-row {
  display: flex;
  justify-content: space-between;
  font-size: 1rem;
  padding-top: 0.5rem;
  border-top: 1px solid #e2e8f0;
}

.form-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.checkbox {
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
}

.chart-container {
  width: 100%;
  min-height: 200px;
}

.app-footer {
  text-align: center;
  padding: 1.5rem;
  color: #64748b;
  font-size: 0.85rem;
}

@media (max-width: 900px) {
  .grid.two,
  .grid.three {
    grid-template-columns: 1fr;
  }

  .nav-tabs {
    justify-content: flex-start;
  }

  main {
    padding: 1.5rem;
  }
}
