:root {
  --bg: #f2f4ef;
  --card: #ffffff;
  --ink: #172121;
  --muted: #516262;
  --accent: #cf5c36;
  --accent-soft: #f2d0c3;
  --line: #d8dfd1;
  --shadow: 0 20px 50px rgba(23, 33, 33, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Space Grotesk", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at 20% 10%, #edf3dc 0%, transparent 35%),
    radial-gradient(circle at 90% 90%, #ffe4d8 0%, transparent 45%), var(--bg);
  overflow-x: hidden;
}

.bg-shape {
  position: fixed;
  border-radius: 999px;
  z-index: -1;
  filter: blur(12px);
  opacity: 0.4;
}

.bg-shape-1 {
  width: 240px;
  height: 240px;
  left: -70px;
  top: 12%;
  background: #e3ecce;
  animation: floatA 8s ease-in-out infinite;
}

.bg-shape-2 {
  width: 280px;
  height: 280px;
  right: -80px;
  bottom: 8%;
  background: #ffd7c6;
  animation: floatB 9s ease-in-out infinite;
}

@keyframes floatA {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-18px);
  }
}

@keyframes floatB {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(22px);
  }
}

.app {
  max-width: 1060px;
  margin: 40px auto;
  padding: 28px;
  background: color-mix(in srgb, var(--card) 88%, #f9fbf2 12%);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
  animation: appear 0.55s ease;
}

@keyframes appear {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero h1 {
  margin: 8px 0;
  font-family: "Fraunces", serif;
  font-size: clamp(2rem, 4.5vw, 3rem);
  letter-spacing: -0.02em;
}

.badge {
  display: inline-block;
  margin: 0;
  background: var(--accent-soft);
  color: #6d2f1b;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
}

.subtitle {
  margin-top: 0;
  color: var(--muted);
}

.controls {
  display: grid;
  grid-template-columns: minmax(220px, 1.8fr) minmax(220px, 1.8fr) minmax(120px, 1fr) minmax(
      130px,
      1fr
    );
  gap: 12px;
  margin: 26px 0 16px;
}

.control-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.compact-field {
  max-width: 170px;
}

.controls label {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--muted);
}

.controls select,
button {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 12px;
  font: inherit;
}

.controls select:focus {
  outline: 2px solid #f1b39c;
  border-color: var(--accent);
}

.status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

#summaryText {
  margin: 0;
  color: var(--muted);
}

button {
  background: var(--accent);
  color: white;
  border: none;
  font-weight: 700;
  cursor: pointer;
}

button:hover {
  filter: brightness(0.95);
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.pager {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 12px;
}

#pageText {
  margin: 0;
  color: var(--muted);
  min-width: 120px;
  text-align: center;
}

.pager button[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: white;
}

th,
td {
  text-align: left;
  padding: 12px;
  border-bottom: 1px solid #edf1e8;
  font-size: 0.94rem;
}

th {
  background: #f8faf4;
  color: #425252;
}

tbody tr {
  transition: background 0.15s ease;
}

tbody tr:hover {
  background: #f9f6ef;
}

.footnote {
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.85rem;
}

@media (max-width: 760px) {
  .app {
    margin: 18px;
    padding: 16px;
  }

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

  .pager {
    justify-content: stretch;
  }

  .pager button {
    flex: 1;
  }

  #pageText {
    min-width: 0;
    flex: 1;
  }

  th,
  td {
    padding: 10px;
    font-size: 0.88rem;
  }
}
