@font-face {
  font-family: "GFL";
  src: url("./fonts/GFL-Medium.woff2") format("woff2");
  font-style: normal;
  font-weight: 500;
  font-display: swap;
}

@font-face {
  font-family: "GFL";
  src: url("./fonts/GFL-Black.woff2") format("woff2");
  font-style: normal;
  font-weight: 900;
  font-display: swap;
}

@font-face {
  font-family: "Space Grotesk";
  src: url("./fonts/SpaceGrotesk-Regular.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Space Grotesk";
  src: url("./fonts/SpaceGrotesk-Bold.woff2") format("woff2");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

:root {
  --gfl-dark: #480000;
  --gfl-light: #ffb6c4;
  --gfl-shadow-dark: #280303;
  --gfl-shadow-light: #ffdce4;
  --bg: #fff8fa;
  --surface: #fff;
  --text: #3c1117;
  --muted: #7c4c57;
  --border: #f0c6cf;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Space Grotesk", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 15% 0%, #ffe2e9 0, transparent 30%),
    radial-gradient(circle at 90% 100%, #ffd7e2 0, transparent 32%),
    var(--bg);
}

h1,
h2,
h3 {
  margin: 0;
  font-family: "GFL", sans-serif;
  letter-spacing: 0.01em;
}

p {
  margin: 0;
}

.app {
  width: min(1200px, 100% - 2rem);
  margin: 1.4rem auto 2.5rem;
}

.hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
}

.eyebrow {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
}

.hero h1 {
  font-size: clamp(1.6rem, 2.8vw, 2.5rem);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  justify-content: flex-end;
}

.card {
  background: var(--surface);
  border-radius: 16px;
  border: 1px solid var(--border);
  box-shadow: 0 10px 24px -14px var(--gfl-shadow-dark), 0 8px 14px -10px var(--gfl-shadow-light);
}

.dashboard {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 0.8rem;
}

.metric-large {
  grid-column: span 2;
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-radius: 16px;
}

.metric-positive {
  background: var(--gfl-light);
  color: var(--gfl-dark);
}

.metric-negative {
  background: var(--gfl-dark);
  color: var(--gfl-light);
}

.metric-label {
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: 0.25rem;
}

.metric-large .metric-label {
  color: inherit;
  opacity: 0.8;
}

.metric-large h2 {
  font-size: clamp(1.4rem, 2.8vw, 2.1rem);
}

.badge {
  padding: 0.3rem 0.55rem;
  border-radius: 999px;
  border: 1px solid currentColor;
  font-size: 0.75rem;
  font-weight: 700;
}

.metric-card {
  padding: 0.9rem;
  border-radius: 16px;
  background: #fff;
  border: 1px solid var(--border);
}

.metric-value {
  font-weight: 700;
  font-size: 1.05rem;
}

.metric-note {
  margin-top: 0.35rem;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.35;
}

.metric-meta {
  display: grid;
  align-content: center;
  gap: 0.15rem;
  font-size: 0.88rem;
}

.metric-compare {
  background: #fff4f7;
}

.main-grid {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: 0.95fr 1.2fr;
  gap: 1rem;
}

.bottom-grid {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 1rem;
}

.panel {
  padding: 1rem;
}

.panel-copy {
  margin-top: 0.3rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.input-section {
  margin-top: 1rem;
  display: grid;
  gap: 0.45rem;
}

.input-section h3 {
  font-size: 1rem;
  margin-bottom: 0.2rem;
}

.choice-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.choice-pill {
  position: relative;
}

.choice-pill input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.choice-pill span {
  display: inline-block;
  border: 1px solid #e2bcc6;
  border-radius: 999px;
  padding: 0.4rem 0.72rem;
  font-size: 0.82rem;
  cursor: pointer;
  background: #fff;
}

.choice-pill input:checked + span {
  background: var(--gfl-dark);
  color: var(--gfl-light);
  border-color: var(--gfl-dark);
}

.checkbox-label {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
}

.checkbox-label input[type="checkbox"] {
  margin-top: 0.18rem;
}

label {
  font-size: 0.9rem;
}

input,
button {
  font-family: inherit;
}

input[type="number"],
input[type="text"] {
  width: 100%;
  padding: 0.55rem 0.6rem;
  border: 1px solid #debdc5;
  border-radius: 9px;
  color: var(--text);
  background: #fff;
}

input:focus,
button:focus-visible {
  outline: 2px solid var(--gfl-light);
  outline-offset: 2px;
}

.help {
  font-size: 0.82rem;
  color: var(--muted);
}

.warning {
  margin-top: 1rem;
  padding: 0.65rem 0.7rem;
  border-radius: 9px;
  background: #ffe9ee;
  color: var(--gfl-dark);
  border: 1px solid #f8b7c8;
  font-size: 0.86rem;
}

.btn {
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 0.5rem 0.7rem;
  cursor: pointer;
  font-weight: 700;
}

.btn-primary {
  background: var(--gfl-dark);
  color: var(--gfl-light);
}

.btn-secondary {
  background: var(--gfl-light);
  color: var(--gfl-dark);
}

.panel-heading {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  align-items: flex-start;
}

.table-wrap,
.computed-wrap {
  margin-top: 1rem;
  overflow: auto;
}

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

th,
td {
  text-align: left;
  padding: 0.5rem 0.4rem;
  border-bottom: 1px solid #f2d2da;
  white-space: nowrap;
}

th {
  font-family: "GFL", sans-serif;
  font-weight: 500;
}

.cell-input {
  min-width: 140px;
  font-size: 0.86rem;
}

.icon-btn {
  background: #ffe8ee;
  color: var(--gfl-dark);
  border: 1px solid #f1bdcb;
  border-radius: 8px;
  padding: 0.36rem 0.55rem;
  cursor: pointer;
}

.total-row td {
  font-weight: 700;
}

.chart {
  margin-top: 0.9rem;
  display: grid;
  gap: 0.45rem;
}

.bar-row {
  display: grid;
  gap: 0.5rem;
  grid-template-columns: minmax(90px, 160px) 1fr 95px;
  align-items: center;
}

.bar-label {
  font-size: 0.84rem;
}

.bar-track {
  background: #ffe6ed;
  border-radius: 999px;
  height: 18px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: var(--gfl-dark);
  border-radius: 999px;
  transition: width 0.35s ease;
}

.bar-variable {
  background: #8c3948;
}

.bar-value {
  text-align: right;
  font-size: 0.83rem;
  color: var(--muted);
}

.status {
  min-height: 1.2rem;
  margin-top: 0.65rem;
  font-size: 0.85rem;
  color: var(--muted);
}

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

  .metric-large {
    grid-column: span 2;
  }

  .main-grid,
  .bottom-grid {
    grid-template-columns: 1fr;
  }

  .metric-meta {
    grid-column: span 2;
  }
}

@media (max-width: 640px) {
  .app {
    width: min(100% - 1rem, 1200px);
    margin: 1rem auto 1.6rem;
  }

  .hero {
    align-items: stretch;
    flex-direction: column;
  }

  .hero-actions {
    justify-content: flex-start;
  }

  .bar-row {
    grid-template-columns: 1fr;
  }

  .bar-value {
    text-align: left;
  }
}
