:root {
  --bg: #f5efe6;
  --bg-accent: #fff7ee;
  --ink: #1a1f24;
  --muted: #6b6660;
  --accent: #e3572f;
  --accent-strong: #c44724;
  --accent-warm: #f2b45b;
  --accent-cool: #0f5b5a;
  --card: #ffffff;
  --border: #e7ded2;
  --shadow: 0 26px 60px rgba(20, 18, 16, 0.16);
  --radius: 20px;
}

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

body {
  margin: 0;
  font-family: "Space Grotesk", "Work Sans", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at 10% 10%, #fff6ea 0%, #f6efe4 45%, #eee5da 100%);
  min-height: 100vh;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: linear-gradient(
      140deg,
      rgba(227, 87, 47, 0.12),
      rgba(15, 91, 90, 0.08)
    ),
    radial-gradient(circle at 12% 18%, rgba(227, 87, 47, 0.18), transparent 42%),
    radial-gradient(circle at 80% 8%, rgba(15, 91, 90, 0.2), transparent 46%);
  z-index: -1;
}

.page {
  max-width: 100%;
  margin: 0 auto;
  padding: 32px 36px 52px;
}

.topbar {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}

.brand .title {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.brand .subtitle {
  font-size: 14px;
  color: var(--muted);
  margin-top: 4px;
}

.searchbar {
  display: flex;
  gap: 12px;
  align-items: center;
  flex: 1;
  justify-content: flex-end;
}

.searchbar input {
  width: min(520px, 100%);
  padding: 12px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  font-size: 15px;
  box-shadow: 0 10px 24px rgba(20, 18, 16, 0.08);
}

.searchbar input:focus {
  outline: 2px solid rgba(227, 87, 47, 0.3);
  border-color: transparent;
}

.primary-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 11px 22px;
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: 0 14px 26px rgba(227, 87, 47, 0.28);
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.primary-btn:hover {
  transform: translateY(-1px);
  background: var(--accent-strong);
  box-shadow: 0 16px 32px rgba(227, 87, 47, 0.32);
}

.panel {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 18px 18px 22px;
  width: 100%;
}

.panel-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}

.control-group {
  display: flex;
  gap: 10px;
  align-items: center;
}

.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-accent);
  cursor: pointer;
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
}

.ghost-btn {
  border-radius: 12px;
  border: 1px solid var(--border);
  background: transparent;
  padding: 8px 14px;
  font-weight: 600;
  cursor: pointer;
}

.control-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--muted);
  font-size: 14px;
}

.pager {
  display: flex;
  gap: 6px;
  align-items: center;
}

.pager button {
  border: 1px solid var(--border);
  background: linear-gradient(180deg, #fff6ea 0%, #f3e8da 100%);
  padding: 7px 12px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border 0.2s ease;
}

.pager button:hover {
  transform: translateY(-1px);
  border-color: rgba(227, 87, 47, 0.4);
  box-shadow: 0 10px 20px rgba(20, 18, 16, 0.1);
}

.pager button.active {
  border-color: transparent;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  box-shadow: 0 12px 24px rgba(227, 87, 47, 0.35);
}

.pager span {
  padding: 0 6px;
}

.page-size {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.page-size select {
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff6ea;
}

.grid {
  height: calc(100vh - 245px);
  min-height: 420px;
  width: 100%;
}

.ag-theme-quartz {
  --ag-font-family: "Work Sans", "Space Grotesk", sans-serif;
  --ag-header-background-color: #f6efe4;
  --ag-row-border-color: #ede3d6;
  --ag-odd-row-background-color: #fbf6ee;
  --ag-border-color: #e9dfd2;
  --ag-header-foreground-color: #2a231b;
  --ag-selected-row-background-color: rgba(227, 87, 47, 0.12);
  --ag-row-hover-color: rgba(15, 91, 90, 0.08);
  --ag-font-size: 14px;
}

.cell-title {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cell-title a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.cell-sub {
  color: var(--muted);
  font-size: 12px;
}

.cell-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: #f6f0e7;
  border: 1px solid var(--border);
  object-fit: contain;
}

.cell-shot {
  width: 120px;
  height: 72px;
  border-radius: 10px;
  border: 1px solid var(--border);
  object-fit: cover;
  background: #f6f0e7;
}

.cell-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(227, 87, 47, 0.3);
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
}

.reveal {
  animation: rise 0.6s ease both;
}

.panel.reveal {
  animation-delay: 0.08s;
}

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

@media (max-width: 960px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .searchbar {
    width: 100%;
    justify-content: flex-start;
  }

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

  .control-meta {
    flex-wrap: wrap;
  }

  .grid {
    height: 70vh;
  }
}

@media (max-width: 720px) {
  .page {
    padding: 24px 18px 40px;
  }

  .panel-controls {
    gap: 12px;
  }

  .pager button {
    padding: 6px 10px;
    font-size: 12px;
  }
}
