/* Researcher/Admin dashboards + login. Loaded alongside styles.css (reuses its :root tokens,
   fonts and body background) -- this file only adds the components those pages need that the
   main explorer never did: auth cards, status badges, claim-review cards, a proportion bar. */

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

.topbar .who {
  font-size: 0.92rem;
  color: var(--muted);
}

.topbar .who strong {
  color: var(--text);
}

.btn {
  font: inherit;
  font-weight: 700;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.7);
  color: var(--text);
  cursor: pointer;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #fff;
  border-color: transparent;
}

.btn-danger {
  background: #a53b2d;
  color: #fff;
  border-color: transparent;
}

.btn-ghost {
  background: transparent;
}

.btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}

/* ── Login ─────────────────────────────────────────────────────── */
.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-card {
  width: min(420px, calc(100vw - 32px));
  background: var(--panel);
  backdrop-filter: blur(18px);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 32px 30px;
}

.auth-card .eyebrow {
  margin-bottom: 6px;
}

.auth-card h1 {
  font-size: 1.9rem;
  margin-bottom: 6px;
}

.auth-card p.lede {
  margin: 0 0 22px;
  font-size: 0.95rem;
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
  font-weight: 700;
}

.field input {
  font: inherit;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
}

.field input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.auth-error {
  margin: 0 0 14px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(165, 59, 45, 0.1);
  border: 1px solid rgba(165, 59, 45, 0.3);
  color: #7a2a1f;
  font-size: 0.88rem;
}

.auth-error[hidden] {
  display: none;
}

.auth-back {
  display: block;
  margin-top: 18px;
  font-size: 0.86rem;
  color: var(--muted);
  text-align: center;
}

/* ── Landing page buttons ─────────────────────────────────────── */
.header-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-bottom: 18px;
}

.header-actions a {
  font-size: 0.82rem;
  font-weight: 700;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--accent-strong);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.55);
}

/* ── Stat tiles + proportion bar (admin + researcher headers) ──── */
.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}

.stat-tile {
  padding: 16px 18px;
  border-radius: 18px;
  background: var(--panel);
  border: 1px solid var(--border);
}

.stat-tile .n {
  font-family: "Fraunces", serif;
  font-size: 2rem;
  line-height: 1;
  display: block;
  margin-bottom: 4px;
}

.stat-tile .label {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.stat-tile[data-tone="good"] .n { color: #1f6b3a; }
.stat-tile[data-tone="critical"] .n { color: #a53b2d; }
.stat-tile[data-tone="warning"] .n { color: #8a6a12; }

.proportion-bar {
  display: flex;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--border);
  margin: 4px 0 10px;
}

.proportion-bar span {
  display: block;
  height: 100%;
}

.proportion-bar .seg-approved { background: #1f6b3a; }
.proportion-bar .seg-rejected { background: #a53b2d; }
.proportion-bar .seg-pending { background: #c9c3ad; }

.proportion-legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 24px;
}

.proportion-legend .dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 3px;
  margin-right: 6px;
  vertical-align: middle;
}

.proportion-legend .dot.approved { background: #1f6b3a; }
.proportion-legend .dot.rejected { background: #a53b2d; }
.proportion-legend .dot.pending { background: #c9c3ad; }

/* ── Filter bar ───────────────────────────────────────────────── */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
  padding: 16px 18px;
  margin-bottom: 20px;
}

.filter-bar label {
  font-size: 0.82rem;
  display: grid;
  gap: 6px;
}

.filter-bar select,
.filter-bar input[type="text"] {
  font: inherit;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.9);
  min-width: 150px;
}

/* ── Status badge ─────────────────────────────────────────────── */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 11px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border: 1px solid var(--border);
}

.status-badge[data-status="pending"] { background: rgba(201, 195, 173, 0.35); color: #6b6550; }
.status-badge[data-status="approved"] { background: rgba(31, 107, 58, 0.14); color: #1f6b3a; }
.status-badge[data-status="rejected"] { background: rgba(165, 59, 45, 0.14); color: #a53b2d; }

/* ── Claim cards ──────────────────────────────────────────────── */
.claim-list {
  display: grid;
  gap: 14px;
}

.claim-card {
  padding: 20px 22px;
}

.claim-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}

.claim-type-chip {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-strong);
  background: rgba(47, 107, 68, 0.1);
  border-radius: 999px;
  padding: 3px 10px;
}

.crop-chip {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 10px;
  text-transform: capitalize;
}

.conflict-chip {
  font-size: 0.72rem;
  font-weight: 700;
  color: #8a6a12;
  background: rgba(165, 120, 20, 0.12);
  border-radius: 999px;
  padding: 3px 10px;
}

.claim-statement {
  font-size: 1.08rem;
  line-height: 1.4;
  margin: 0 0 12px;
}

.claim-statement b {
  color: var(--accent-strong);
}

.evidence-list {
  display: grid;
  gap: 8px;
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
}

.evidence-item {
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid var(--border);
  font-size: 0.88rem;
}

.evidence-item .quote {
  display: block;
  margin-bottom: 4px;
  color: var(--text);
}

.evidence-item .cite {
  color: var(--muted);
  font-size: 0.82rem;
}

.evidence-item .cite a {
  color: var(--accent-strong);
}

.review-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: start;
  border-top: 1px solid var(--border);
  padding-top: 14px;
}

.review-controls textarea {
  font: inherit;
  flex: 1 1 260px;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.9);
  resize: vertical;
}

.review-meta {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 8px;
}

.pagination {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 22px 0;
  align-items: center;
  font-size: 0.86rem;
  color: var(--muted);
}

.empty-state {
  padding: 40px 24px;
  text-align: center;
  color: var(--muted);
}

/* ── Admin table ──────────────────────────────────────────────── */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.admin-table th,
.admin-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.admin-table th {
  color: var(--muted);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.toast {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent-strong);
  color: #fff;
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 700;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.toast.show {
  opacity: 1;
}
