/* Theme variables */
:root {
  --cream: #f7f2ec;
  --peach: #f7d6cf;
  --mint: #d7efe6;
  --lavender: #e6def7;
  --sky: #d7e7f7;
  --ink: #3a2f2a;
  --muted: #6f635d;
  --card: rgba(255, 255, 255, 0.78);
  --shadow: 0 20px 50px rgba(93, 70, 60, 0.18);
  --accent: #e7a6b1;
}

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

/* Page background */
body {
  margin: 0;
  font-family: "Manrope", "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at top left, var(--mint), transparent 55%),
    radial-gradient(circle at top right, var(--lavender), transparent 45%),
    linear-gradient(140deg, var(--cream), var(--peach));
  min-height: 100vh;
}

/* Layout wrapper */
.page {
  padding: 48px 6vw 120px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

/* Hero grid */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 24px;
  align-items: center;
}

/* Small heading */
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.32em;
  font-size: 0.68rem;
  color: var(--muted);
  margin: 0 0 8px;
}

/* Title styles */
h1,
h2 {
  font-family: "Fraunces", "Times New Roman", serif;
  margin: 0;
}

h1 {
  font-size: clamp(2.2rem, 3vw, 3rem);
}

/* Subtitle */
.subtitle {
  font-size: 1rem;
  color: var(--muted);
  margin-top: 12px;
  max-width: 520px;
}

/* Filter panel */
.filters {
  display: grid;
  gap: 14px;
  background: var(--card);
  padding: 20px;
  border-radius: 18px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

/* Input labels */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.9rem;
}

.field span {
  color: var(--muted);
}

/* Form controls */
select,
.btn {
  padding: 10px 12px;
  border-radius: 12px;
  border: none;
  font-size: 0.95rem;
  font-family: inherit;
  background: #fff;
  color: var(--ink);
}

/* Primary button */
.btn {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 20px rgba(231, 166, 177, 0.3);
}

/* Card grid */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 22px;
}

/* Split layout */
.split {
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
}

/* Card visuals */
.card {
  background: var(--card);
  border-radius: 22px;
  padding: 20px 22px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  position: relative;
  animation: fadeUp 0.6s ease both;
}

/* Staggered reveals */
.card:nth-child(2) {
  animation-delay: 0.08s;
}

.card:nth-child(3) {
  animation-delay: 0.16s;
}

.card.wide {
  animation-delay: 0.24s;
}

/* Highlighted card */
.highlight {
  background: linear-gradient(120deg, var(--sky), var(--lavender));
}

/* List layout */
.list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.list.compact {
  gap: 14px;
}

/* List item */
.item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.7);
}

.item span {
  color: var(--muted);
}

/* Totals */
.total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 14px;
  font-weight: 600;
}

/* Result highlight */
.result-label {
  margin: 14px 0 8px;
  color: var(--muted);
}

.result-value {
  font-size: 2rem;
  font-weight: 700;
}

.result-value.negative {
  color: #b45050;
}

/* Table header */
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.hint {
  font-size: 0.85rem;
  color: var(--muted);
}

/* Table rows */
.table {
  margin-top: 16px;
  display: grid;
  gap: 10px;
}

.row {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
}

.row.header {
  font-weight: 600;
  background: rgba(255, 255, 255, 0.9);
}

/* Floating refresh button */
.refresh {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: none;
  background: var(--ink);
  color: #fff;
  box-shadow: 0 16px 32px rgba(58, 47, 42, 0.35);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: transform 0.2s ease, background 0.2s ease;
}

.refresh:hover {
  transform: translateY(-3px) rotate(-8deg);
  background: #2a221f;
}

.refresh svg {
  width: 22px;
  height: 22px;
}

/* Footer */
.footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin-top: 8px;
  text-align: center;
}

.footer-eyebrow {
  margin-bottom: 2px;
}

.footer .eyebrow {
  margin: 0;
}

/* Entrance animation */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Tablet adjustments */
@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .split {
    grid-template-columns: 1fr;
  }

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

/* Mobile adjustments */
@media (max-width: 600px) {
  .page {
    padding: 32px 6vw 120px;
  }

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