:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-soft: #f0f4ff;
  --ink: #152033;
  --muted: #607089;
  --line: #dde5f2;
  --brand: #2563eb;
  --brand-dark: #123ea8;
  --accent: #0f766e;
  --danger: #b42318;
  --shadow: 0 18px 45px rgba(37, 65, 111, 0.12);
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: radial-gradient(circle at top left, #dfeaff 0, rgba(223, 234, 255, 0) 34rem), var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

a {
  color: var(--brand-dark);
}

button,
input,
select {
  font: inherit;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 1rem;
  z-index: 10;
  padding: 0.75rem 1rem;
  background: var(--ink);
  color: #fff;
  border-radius: 999px;
}

.skip-link:focus {
  left: 1rem;
}

.hero {
  background: linear-gradient(135deg, #0f172a 0%, #123ea8 54%, #0f766e 100%);
  color: #fff;
  padding: 5rem 1.25rem 6.5rem;
}

.hero__content,
.page-shell,
.footer {
  width: min(1180px, calc(100% - 2rem));
  margin-inline: auto;
}

.hero h1 {
  max-width: 800px;
  margin: 0;
  font-size: clamp(2.25rem, 6vw, 5rem);
  letter-spacing: -0.06em;
  line-height: 0.95;
}

.hero__lead {
  max-width: 720px;
  margin: 1.25rem 0 0;
  color: rgba(255, 255, 255, 0.84);
  font-size: clamp(1.05rem, 2vw, 1.35rem);
}

.hero__actions,
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.hero__actions {
  margin-top: 2rem;
}

.eyebrow {
  margin: 0 0 0.45rem;
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hero .eyebrow {
  color: #a7f3d0;
}

.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 0.45rem;
  min-height: 2.75rem;
  padding: 0.7rem 1rem;
  border: 0;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.button:hover,
.button:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.24);
}

.button--light {
  background: #fff;
  color: var(--brand-dark);
}

.button--ghost {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28);
}

.button--secondary {
  background: var(--surface-soft);
  color: var(--brand-dark);
  box-shadow: inset 0 0 0 1px #cfe0ff;
}

.button--danger {
  background: #fff1f0;
  color: var(--danger);
  box-shadow: inset 0 0 0 1px #ffd4cf;
}

.page-shell {
  margin-top: -4.25rem;
  padding-bottom: 3rem;
}

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

.summary-card,
.panel {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(221, 229, 242, 0.9);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.summary-card {
  padding: 1.2rem;
  min-height: 150px;
}

.summary-card--primary {
  background: linear-gradient(135deg, #ffffff 0%, #eef5ff 100%);
}

.summary-card__label,
.summary-card__unit,
.summary-card small {
  display: block;
  color: var(--muted);
}

.summary-card__label {
  font-weight: 800;
}

.summary-card strong {
  display: block;
  margin-top: 0.75rem;
  font-size: clamp(2rem, 4vw, 3rem);
  letter-spacing: -0.05em;
  line-height: 0.95;
}

.summary-card small {
  margin-top: 0.6rem;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(330px, 0.8fr);
  gap: 1rem;
  margin-top: 1rem;
}

.panel {
  padding: clamp(1rem, 2vw, 1.5rem);
}

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1.15rem;
}

.section-heading--stacked {
  align-items: flex-start;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(1.35rem, 2vw, 2rem);
  letter-spacing: -0.035em;
}

.section-heading p:not(.eyebrow) {
  margin: 0.4rem 0 0;
  color: var(--muted);
}

.settings-form,
.quick-add {
  display: grid;
  gap: 0.85rem;
}

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

.quick-add {
  grid-template-columns: 2fr repeat(4, minmax(90px, 1fr)) auto;
  align-items: end;
  margin-bottom: 1rem;
  padding: 1rem;
  background: var(--surface-soft);
  border-radius: 18px;
}

label {
  display: grid;
  gap: 0.4rem;
  color: var(--muted);
  font-size: 0.87rem;
  font-weight: 800;
}

input,
select {
  width: 100%;
  min-height: 2.7rem;
  padding: 0.58rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 18px;
}

.load-table {
  width: 100%;
  min-width: 1160px;
  border-collapse: collapse;
  background: #fff;
}

.load-table th,
.load-table td {
  padding: 0.72rem 0.65rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

.load-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8fbff;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.load-table tfoot th,
.load-table tfoot td {
  background: #f8fbff;
  color: var(--ink);
  font-weight: 900;
}

.load-table input[type="number"] {
  width: 6rem;
}

.load-table input[type="text"] {
  min-width: 9rem;
}

.load-table input[type="checkbox"] {
  width: 1.25rem;
  min-height: 1.25rem;
  accent-color: var(--brand);
}

.load-table .notes-field {
  min-width: 14rem;
}

.calc-cell {
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}

.result-list {
  display: grid;
  gap: 0.8rem;
}

.result-list > div {
  display: grid;
  gap: 0.25rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fbfdff;
}

.result-list span,
.result-list small {
  color: var(--muted);
}

.result-list strong {
  font-size: 1.4rem;
}

.bar-list {
  display: grid;
  gap: 0.85rem;
}

.bar-item {
  display: grid;
  gap: 0.35rem;
}

.bar-item__top {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-weight: 800;
}

.bar-item__track {
  height: 0.8rem;
  overflow: hidden;
  border-radius: 999px;
  background: #e9eef7;
}

.bar-item__fill {
  display: block;
  width: var(--bar-width, 0%);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), var(--accent));
}

.empty-state {
  padding: 1.25rem;
  color: var(--muted);
  background: #fbfdff;
  border: 1px dashed var(--line);
  border-radius: 16px;
}

.notes p {
  margin: 0 0 0.75rem;
}

.footer {
  padding: 0 0 3rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.footer__links {
  margin-top: 0.4rem;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 1020px) {
  .summary-grid,
  .content-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 720px) {
  .hero {
    padding-top: 3.5rem;
  }

  .summary-grid,
  .content-grid,
  .settings-form,
  .quick-add {
    grid-template-columns: 1fr;
  }

  .section-heading {
    display: grid;
  }

  .toolbar,
  .hero__actions {
    align-items: stretch;
  }

  .toolbar .button,
  .hero__actions .button {
    width: 100%;
  }
}

@media print {
  body {
    background: #fff;
  }

  .hero,
  .toolbar,
  .quick-add,
  .button,
  .footer {
    display: none !important;
  }

  .page-shell {
    width: 100%;
    margin: 0;
    padding: 0;
  }

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

  .summary-card,
  .panel {
    box-shadow: none;
    break-inside: avoid;
  }

  .table-wrapper {
    overflow: visible;
  }

  .load-table {
    min-width: 0;
    font-size: 0.72rem;
  }
}
