@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;700&family=Noto+Sans+SC:wght@400;500;700&display=swap");

:root {
  --bg: #f3efe6;
  --panel: #fffdf9;
  --ink: #1f2a37;
  --muted: #59667a;
  --line: #d9d3c6;
  --brand: #0d8a78;
  --brand-2: #cf6a32;
  --warn: #a33a36;
  --ok: #1f7a4d;
  --shadow: 0 12px 35px rgba(49, 33, 14, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Noto Sans SC", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at 12% 0%, #fff8e8 0%, transparent 50%),
    radial-gradient(circle at 90% 15%, #eaf8f7 0%, transparent 45%), var(--bg);
}

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

.bg-shape-a {
  width: 320px;
  height: 320px;
  background: #f5b26f;
  top: -110px;
  left: -70px;
}

.bg-shape-b {
  width: 300px;
  height: 300px;
  background: #62c8bb;
  bottom: -120px;
  right: -60px;
}

.layout {
  width: min(1440px, calc(100% - 32px));
  margin: 24px auto 36px;
  display: grid;
  gap: 18px;
}

.hero {
  background: linear-gradient(130deg, #083f56 0%, #226f67 45%, #cb6e3c 100%);
  color: #ffffff;
  border-radius: 18px;
  padding: 24px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-end;
  box-shadow: var(--shadow);
  animation: show-up 320ms ease-out both;
}

.hero h1 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(1.7rem, 2.2vw, 2.2rem);
}

.hero p {
  margin: 10px 0 0;
  color: #f5f8fa;
}

.hero-actions {
  text-align: right;
  display: grid;
  gap: 8px;
}

.switch-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
}

button,
select,
input {
  font: inherit;
}

button {
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
  background: var(--brand);
  color: #fff;
  transition: transform 180ms ease, background 180ms ease;
}

button:hover {
  transform: translateY(-1px);
  background: #0a7668;
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.ghost-btn {
  background: transparent;
  border-color: var(--line);
  color: var(--muted);
}

.ghost-btn:hover {
  background: #f1eee6;
  color: var(--ink);
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 6px 20px rgba(44, 30, 14, 0.08);
  animation: show-up 320ms ease-out both;
}

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

.panel-title-row h2 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.1rem;
}

.filters {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.filters label,
.compact-controls label {
  display: grid;
  gap: 6px;
  font-size: 0.88rem;
  color: var(--muted);
}

.filters input,
.filters select,
.compact-controls select {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: #fff;
  color: var(--ink);
}

.submit-wrap {
  display: flex;
  align-items: end;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}

.stat-card {
  border-radius: 12px;
  padding: 14px;
  background: #fff;
  border: 1px solid var(--line);
  overflow: hidden;
  position: relative;
}

.stat-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
}

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

.stat-value {
  margin-top: 8px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.45rem;
}

.split-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr 1.3fr;
}

.compact-controls {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

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

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

th,
td {
  border-bottom: 1px solid #e8e2d8;
  padding: 9px;
  text-align: left;
  white-space: nowrap;
  font-size: 0.88rem;
}

thead th {
  font-weight: 700;
  color: #394657;
}

tbody tr:hover {
  background: #f5f7f8;
}

.ok-tag,
.fail-tag {
  font-weight: 700;
}

.ok-tag {
  color: var(--ok);
}

.fail-tag {
  color: var(--warn);
}

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

.error-box {
  border: 1px solid #f2beb6;
  background: #fff3f1;
  color: #8a2f2a;
  border-radius: 12px;
  padding: 10px 12px;
}

.hidden {
  display: none;
}

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

@media (max-width: 1180px) {
  .filters {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

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

@media (max-width: 760px) {
  .layout {
    width: calc(100% - 20px);
    margin-top: 12px;
  }

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

  .hero-actions {
    width: 100%;
    text-align: left;
  }

  .switch-wrap {
    justify-content: flex-start;
  }

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

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

.zero-success { background-color: var(--warn); color: white; font-weight: bold; }
