*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

.lib-link { color: #64748b; font-size: .875rem; text-decoration: none; }
.lib-link:hover { color: #2563eb; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: #f1f5f9;
  color: #0f172a;
  min-height: 100vh;
}

/* ── Page layout ─────────────────────────────────────────── */
.page { max-width: 980px; margin: 0 auto; padding: 3rem 1.5rem 5rem; display: flex; flex-direction: column; gap: 2.5rem; }

.page__hero h1 { font-size: 2.25rem; font-weight: 800; letter-spacing: -.02em; margin-bottom: .5rem; }
.page__hero p  { color: #64748b; font-size: 1.0625rem; max-width: 600px; }

/* ── Architecture block ──────────────────────────────────── */
.page__arch h2, .page__why h2 { font-size: 1.25rem; font-weight: 700; margin-bottom: 1rem; }

.code-block {
  background: #0f172a;
  color: #94a3b8;
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  font-size: .875rem;
  line-height: 1.7;
  overflow-x: auto;
  white-space: pre;
}
.code-block .hl  { color: #7dd3fc; font-weight: 600; }
.code-block .ok  { color: #86efac; }
.code-block .mut { color: #fda4af; }

/* ── Table section ───────────────────────────────────────── */
.page__table { display: flex; flex-direction: column; gap: 1rem; }

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  align-items: center;
  background: #fff;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  padding: .875rem 1.125rem;
}

.filter-input {
  flex: 1;
  min-width: 200px;
  padding: .5rem .75rem;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: .9375rem;
  outline: none;
  transition: border-color .18s;
}
.filter-input:focus { border-color: #2563eb; }

.status-select {
  padding: .5rem .75rem;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: .9375rem;
  background: #fff;
  outline: none;
  cursor: pointer;
}

.filter-count { color: #64748b; font-size: .875rem; margin-left: auto; }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  padding: .5rem 1rem;
  border: 1.5px solid transparent;
  border-radius: 8px;
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .15s, transform .1s;
  white-space: nowrap;
}
.btn:hover  { opacity: .85; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .4; cursor: not-allowed; transform: none; }

.btn--sm      { padding: .375rem .75rem; font-size: .8125rem; }
.btn--primary { background: #2563eb; color: #fff; }
.btn--danger  { background: #dc2626; color: #fff; }
.btn--outline { background: transparent; border-color: #cbd5e1; color: #334155; }
.btn--outline:hover { border-color: #2563eb; color: #2563eb; }

/* ── Table wrap ──────────────────────────────────────────── */
.table-wrap { position: relative; background: #fff; border: 1.5px solid #e2e8f0; border-radius: 10px; overflow: hidden; min-height: 320px; }

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9375rem;
}
.data-table th, .data-table td {
  text-align: left;
  padding: .75rem 1rem;
  border-bottom: 1px solid #f1f5f9;
}
.data-table th {
  background: #f8fafc;
  font-size: .8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #475569;
}
.th-sortable { cursor: pointer; user-select: none; transition: color .15s; }
.th-sortable:hover { color: #2563eb; }
.sort-icon { color: #2563eb; }

.dt-row:last-child td { border-bottom: none; }
.dt-row:hover td { background: #f8fafc; }

/* ── Status badges ───────────────────────────────────────── */
.status {
  display: inline-block;
  padding: .2rem .6rem;
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 600;
}
.status--active    { background: #dcfce7; color: #166534; }
.status--pending   { background: #fef9c3; color: #854d0e; }
.status--inactive  { background: #f1f5f9; color: #475569; }
.status--suspended { background: #fee2e2; color: #991b1b; }

/* ── Overlay ─────────────────────────────────────────────── */
.table-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  border-radius: 10px;
}
.table-overlay--hidden { display: none; }
.error-msg { color: #dc2626; font-weight: 600; font-size: .9375rem; }

/* ── Spinner ─────────────────────────────────────────────── */
.spinner {
  width: 36px; height: 36px;
  border: 3px solid #e2e8f0;
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Pagination ──────────────────────────────────────────── */
.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .75rem;
  background: #fff;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  padding: .75rem 1.125rem;
}
.pagination__info  { color: #64748b; font-size: .875rem; }
.pagination__controls { display: flex; align-items: center; gap: .5rem; margin-left: auto; }
.pagination__pages { font-size: .875rem; color: #334155; }

.page-size-select {
  padding: .375rem .625rem;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: .8125rem;
  background: #fff;
  cursor: pointer;
}

/* ── Why Objs compare ───────────────────────────────────── */
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 600px) { .compare { grid-template-columns: 1fr; } }

.compare__col { background: #fff; border: 1.5px solid #e2e8f0; border-radius: 10px; padding: 1.25rem; }
.compare__col h3 { font-size: .9375rem; font-weight: 700; margin-bottom: .75rem; }
.compare__col--react h3 { color: #64748b; }
.compare__col--objs  h3 { color: #2563eb; }
.compare__col pre { font-size: .8125rem; line-height: 1.65; color: #334155; white-space: pre-wrap; word-break: break-word; }
