/* === DESIGN TOKENS === */
:root {
  --bg-1: #eef3fc;
  --bg-2: #dde7f8;
  --brand: #2563eb;
  --brand-deep: #1d4ed8;
  --brand-soft: #e8efff;
  --brand-softer: #f3f6fe;
  --ink: #0f1c3f;
  --ink-2: #25304f;
  --muted: #6b7591;
  --line: #e6eaf4;
  --line-2: #eef1f8;
  --card: #ffffff;
  --crown: #f59e0b;
  --check: #10b981;
  --star: #8b5cf6;
  --r-card: 14px;
  --r-pill: 999px;
  --r-input: 10px;
}

/* === BASE === */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Manrope", ui-sans-serif, system-ui, sans-serif;
  background: linear-gradient(180deg, var(--bg-1) 0%, var(--bg-2) 100%);
  background-attachment: fixed;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  font-size: 14px;
  letter-spacing: -0.005em;
}

/* === .page WRAPPER === */
.page {
  max-width: 1440px;
  margin: 0 auto;
  padding: 24px 32px 64px;
}

/* === .layout (sidebar + content grid) === */
.layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 22px;
  margin-top: 22px;
  align-items: start;
}

/* === .sidebar (filter sidebar) === */
.sidebar {
  background: var(--card);
  border-radius: 16px;
  padding: 6px 0 8px;
  box-shadow: 0 1px 0 rgba(15,28,63,0.04), 0 8px 24px -16px rgba(15,28,63,0.18);
  position: sticky;
  top: 16px;
  max-height: calc(100vh - 32px);
  display: flex;
  flex-direction: column;
}

/* === .sb-head (sidebar header) === */
.sb-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px 10px;
  border-bottom: 1px solid var(--line-2);
  position: relative;
}
.sb-head h2 {
  margin: 0; font-size: 15px; font-weight: 700; color: var(--ink);
  display: flex; align-items: center; gap: 8px;
}
.sb-head h2 .ico {
  width: 26px; height: 26px; display: grid; place-items: center;
  border-radius: 8px; background: var(--brand-soft); color: var(--brand);
}
.sb-close {
  display: none;
  place-items: center;
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  width: 32px; height: 32px; border-radius: 8px;
  border: 1px solid var(--line); background: #fff;
  color: var(--ink-2); cursor: pointer;
}
.sb-reset {
  border: 0; background: transparent; color: var(--brand);
  font: inherit; font-size: 12px; font-weight: 600;
  padding: 6px 8px; border-radius: 6px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 4px;
}
.sb-reset:hover { background: var(--brand-soft); }

/* === .sb-scroll === */
.sb-scroll {
  overflow-y: auto; padding: 4px 6px 6px; flex: 1;
}
.sb-scroll::-webkit-scrollbar { width: 8px; }
.sb-scroll::-webkit-scrollbar-thumb {
  background: #d6dceb; border-radius: 4px;
}

/* === .apply-wrap === */
.apply-wrap { padding: 12px 14px 6px; flex-shrink: 0; }
.apply {
  width: 100%; height: 42px; border: 0; border-radius: 10px;
  background: var(--brand); color: #fff; font: inherit;
  font-weight: 700; font-size: 14px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; box-shadow: 0 6px 14px -6px rgba(37,99,235,0.55);
  transition: background .15s, transform .05s;
}
.apply:hover { background: var(--brand-deep); }
.apply:active { transform: translateY(1px); }

/* === .content-area-wrapper (main results area) === */
.content-area-wrapper { min-width: 0; }

/* === .results-head === */
.results-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 4px 4px 14px;
}
.results-head h1 {
  margin: 0; font-size: 18px; font-weight: 700;
  color: var(--ink); letter-spacing: -0.01em;
}
.results-head h1 em {
  font-style: normal; color: var(--muted);
  font-weight: 600; margin-left: 6px;
}
.filter-trigger {
  display: none;
  align-items: center; gap: 8px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 10px; padding: 8px 14px; height: 38px;
  font: inherit; font-size: 13px; font-weight: 700;
  color: var(--ink); cursor: pointer;
  box-shadow: 0 1px 0 rgba(15,28,63,0.04);
}
.filter-trigger svg { color: var(--brand); }

/* === Loading and no-data states === */
.loading-spinner {
  display: flex; justify-content: center; align-items: center;
  padding: 60px 20px; min-height: 200px;
}
.spinner {
  width: 36px; height: 36px; border-radius: 50%;
  border: 3px solid var(--line);
  border-top-color: var(--brand);
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.no-data {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 60px 20px; text-align: center; color: var(--muted);
}
.no-data h3 { margin: 0 0 8px; font-size: 16px; font-weight: 700; color: var(--ink-2); }
.no-data p { margin: 0; font-size: 14px; }

/* === Pagination === */
.pagination {
  display: flex; align-items: center; justify-content: center;
  gap: 8px; padding: 24px 0 16px; flex-wrap: wrap;
}
.pagination-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: var(--r-input);
  border: 1px solid var(--line); background: var(--card);
  font: inherit; font-size: 13px; font-weight: 600;
  color: var(--ink-2); cursor: pointer;
  transition: background .15s, border-color .15s;
}
.pagination-btn:hover:not(:disabled) {
  background: var(--brand-softer); border-color: var(--brand);
  color: var(--brand);
}
.pagination-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.pagination-numbers { display: flex; align-items: center; gap: 4px; }
.page-number {
  width: 34px; height: 34px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--card);
  font: inherit; font-size: 13px; font-weight: 600;
  color: var(--ink-2); cursor: pointer;
  display: grid; place-items: center;
  transition: background .15s, border-color .15s, color .15s;
}
.page-number:hover { background: var(--brand-softer); color: var(--brand); }
.page-number.active {
  background: var(--brand); border-color: var(--brand); color: #fff;
}
.page-ellipsis {
  display: grid; place-items: center;
  width: 34px; height: 34px; color: var(--muted); font-size: 13px;
}
.pagination-info { font-size: 12px; color: var(--muted); font-weight: 600; }

/* === .scrim (mobile overlay) === */
.scrim {
  display: none;
  position: fixed; inset: 0;
  background: rgba(15,28,63,0.5);
  z-index: 90;
  opacity: 0;
  transition: opacity .2s;
  pointer-events: none;
}
.scrim.is-open {
  opacity: 1;
  pointer-events: auto;
}

/* === RESPONSIVE BREAKPOINTS === */

/* Tablet <= 1024px */
@media (max-width: 1024px) {
  .page { padding: 16px 20px 48px; }
  .layout { grid-template-columns: 240px 1fr; gap: 16px; }
}

/* Mobile <= 768px */
@media (max-width: 768px) {
  .page { padding: 12px 14px 56px; }

  .layout { grid-template-columns: 1fr; gap: 14px; margin-top: 14px; }

  /* Sidebar becomes a slide-out drawer from the right */
  .sidebar {
    position: fixed;
    top: 0; right: 0; bottom: 0; left: auto;
    width: min(86vw, 360px);
    max-height: 100vh;
    border-radius: 18px 0 0 18px;
    z-index: 100;
    transform: translateX(100%);
    transition: transform .25s ease;
    box-shadow: -16px 0 40px -10px rgba(15,28,63,0.25);
    padding-top: 4px;
  }
  .sidebar.is-open { transform: translateX(0); }
  .sb-head { padding-right: 52px; }
  .sb-close { display: grid; }
  .scrim { display: block; }

  .results-head { padding: 4px 2px 10px; gap: 10px; }
  .results-head h1 { font-size: 16px; }
  .filter-trigger { display: inline-flex; }
}

/* Small mobile <= 380px */
@media (max-width: 380px) {
  .page { padding: 12px 10px 56px; }
  .results-head h1 { font-size: 15px; }
}
