/* IBM Plex Sans loaded via Google Fonts in index.html */

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

body {
  margin: 0;
  font-family: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.4;
  color: #1c1a17;
  background: #f9f7f7;
}

a { color: #1565c0; text-decoration: underline; text-underline-offset: 2px; }
a:visited { color: #7b2fbe; }
a:hover   { color: #1050a0; }

/* ── Action bar ─────────────────────────────────────────── */
.action-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #f0f5cb;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 50px;
  gap: 16px;
  border-bottom: 1px solid #ccd86a;
}

.action-bar-nav { display: flex; gap: 6px; align-items: center; }
.action-bar-counter {
  font-size: 13px;
  font-weight: 500;
  color: #1c1a17;
  white-space: nowrap;
}
.action-bar-actions { display: flex; gap: 8px; align-items: center; }

/* ── Page layout ─────────────────────────────────────────── */
.page {
  max-width: 1080px;
  margin: 0 auto;
  padding: 28px 24px 56px;
}

.page-title {
  font-family: "IBM Plex Sans", sans-serif;
  font-size: 22px;
  font-weight: 600;
  margin: 0 0 20px;
  color: #1c1a17;
  display: flex;
  align-items: center;
  gap: 10px;
}

.title-count {
  font-family: "IBM Plex Sans", sans-serif;
  font-size: 13px;
  font-weight: 500;
  background: #e8e4df;
  color: #6b6459;
  border-radius: 999px;
  padding: 2px 10px;
  letter-spacing: 0;
}

/* ── User info block — full-width grid below papers ─────── */
.info-card-wide {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-top: 28px;
}
.info-card-wide .info-card-row {
  border-bottom: none;
  border-right: 1px solid rgba(0, 0, 0, 0.07);
  padding: 14px 20px;
}
.info-card-wide .info-card-row:last-child { border-right: none; }

/* ── Papers toolbar (filter row) ──────────────────────────── */
.papers-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-bottom: 8px;
}
.papers-filter {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: #6b6459;
}
.papers-filter label {
  font-weight: 500;
  white-space: nowrap;
}
.papers-filter select {
  font-family: inherit;
  font-size: 12px;
  color: #1c1a17;
  background: none;
  border: none;
  border-bottom: 1px solid #8b8680;
  padding: 1px 18px 1px 2px;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%238b8680'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 2px center;
}
.papers-filter select:focus-visible {
  outline: 2px solid #1565c0;
  outline-offset: 2px;
  border-radius: 2px;
}

/* ── Filtered-out rows ───────────────────────────────────── */
.papers-table tbody tr.filter-hidden { display: none; }

/* ── Papers table ─────────────────────────────────────────── */
.papers-section { margin-bottom: 0; }

.papers-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  background: #fff;
  border: 1px solid #ddd8d2;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 28px;
}

.papers-table th {
  font-family: "IBM Plex Sans Condensed", "IBM Plex Sans", sans-serif;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6b6459;
  background: #f0eeec;
  text-align: left;
  padding: 8px 14px;
  border-bottom: 1px solid #ddd8d2;
}

.papers-table td {
  padding: 10px 14px;
  vertical-align: top;
  border-bottom: 1px solid #f0eeec;
  color: #1c1a17;
}
.papers-table tbody tr:last-child td { border-bottom: none; }

/* ── 3-column layout
   LEFT  col-meta:     pure status rail — no content, carries only the
                       semantic rail color. arXiv ID moved inline with title.
   CENTER (default):   title (+ inline ID) → submitter → author list.
   RIGHT col-decision: the decision action. Reading order: scan → evaluate → decide.
──────────────────────────────────────────────────────────────────────── */
.papers-table .col-meta     { width: 8px; padding: 0; }
.papers-table th.col-meta   { padding: 0; }
.papers-table .col-decision { width: 165px; }

/* ── Left rail — semantic status color ────────────────────
   The rail color IS the status of the row, mirroring the
   paradigm used in the existing admin queue tool:
     Gray   — no decision yet (pending/undecided)
     Amber  — needs attention before deciding (name mismatch)
     Green  — accepted (Author or Proxy selected)
     Red    — rejected (No selected)
   Amber is overridden by green/red once a decision is made —
   the decision state always takes priority over the flag.
──────────────────────────────────────────────────────────── */

/* Default: gray — undecided, no flags */
.papers-table tbody tr > td:first-child {
  box-shadow: inset 3px 0 0 0 #b0aba6;
}

/* Amber — name mismatch, still undecided (needs attention) */
.papers-table tbody tr.no-name-match:not([data-decision]) > td:first-child {
  box-shadow: inset 3px 0 0 0 #e8b800;
}

/* Green — accepted (Author or Proxy); overrides amber flag */
.papers-table tbody tr[data-decision="author"] > td:first-child,
.papers-table tbody tr[data-decision="proxy"] > td:first-child {
  box-shadow: inset 3px 0 0 0 #5a9e2a;
}

/* Red — rejected; overrides amber flag */
.papers-table tbody tr[data-decision="no"] > td:first-child {
  box-shadow: inset 3px 0 0 0 #c62828;
}

/* Row background shifts with decision state */
.papers-table tbody tr                        { background: #fff; transition: background 0.15s; }
.papers-table tbody tr[data-decision="author"] { background: #f4fbee; }
.papers-table tbody tr[data-decision="proxy"]  { background: #f0f5ff; }
.papers-table tbody tr[data-decision="no"]     { background: #fff6f6; }

/* ── Inline metadata labels ───────────────────────────────
   .meta-label is used inline (e.g. "Submitter") within center-column
   content. Tiny uppercase caption, visually dim, sits on the same
   line as its value.
──────────────────────────────────────────────────────────── */
.meta-label {
  display: inline;
  font-family: "IBM Plex Sans Condensed", "IBM Plex Sans", sans-serif;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #b0aba6;
  margin-right: 5px;
}

/* ── arXiv ID — inline after paper title ─────────────────
   Sits on the same line as the title, visually secondary via
   smaller size and monospace font. The title's font-weight 500
   naturally draws the eye first.
──────────────────────────────────────────────────────────── */
.arxiv-id {
  display: inline;
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  font-weight: 400;
  color: #1565c0;
  text-decoration: underline;
  text-underline-offset: 2px;
  margin-left: 0;
  margin-right: 10px;
  white-space: nowrap;
}
.arxiv-id:visited { color: #7b2fbe; }
.arxiv-id:hover   { color: #1050a0; }

.submitter-name {
  font-size: 12px;
  color: #1565c0;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.submitter-name:visited { color: #7b2fbe; }
.submitter-name:hover   { color: #1050a0; }

/* ── Proxy submitter label ───────────────────────────────── */
.proxy-via {
  display: inline;
  font-size: 11px;
  color: #6b6459;
  margin-left: 6px;
  font-style: italic;
}

/* ── Center column: title → submitter → authors ───────────
   Stacking order puts submitter directly above the author list
   so the admin can compare them at a glance. The "Submitter"
   micro-label (reusing .meta-label) distinguishes the submitter
   line from the author list below it.
──────────────────────────────────────────────────────────── */
.paper-title {
  font-weight: 500;
  line-height: 1.4;
  margin-bottom: 8px;
  color: #1c1a17;
}

.paper-submitter {
  margin-bottom: 6px;
}

.paper-authors {
  font-size: 12px;
  color: #5a5450;
  line-height: 1.45;
}

/* ── Author exact-match highlight ─────────────────────────── */
mark.requestor {
  background: #d8f0b0;
  color: inherit;
  border-radius: 2px;
  padding: 0 2px;
}

/* ── Large collaboration author list ─────────────────────────
   Both-sides ellipsis makes clear the excerpt is from the
   middle of a long list, not the start.
──────────────────────────────────────────────────────────── */
.authors-long { line-height: 1.6; }

.authors-show-all {
  display: inline;
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  white-space: nowrap;
  margin-left: 3px;
}

/* ── No-name-match row: badge ─────────────────────────────
   The rail color (amber) is handled in the semantic rail
   section above. The badge provides a second, cell-level
   signal in the Authors cell for when the admin reads the content.
──────────────────────────────────────────────────────────── */
.no-match-warning {
  display: inline-block;
  background: #fff8e1;
  border: 1px solid #e8b800;
  color: #7a5c00;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 500;
  padding: 2px 7px;
  margin-bottom: 6px;
  white-space: nowrap;
}

/* ── Decision segmented control ───────────────────────────── */
.col-decision { vertical-align: middle; }

.decision-group {
  border: none;
  margin: 0;
  padding: 0;
  display: inline-flex;
  gap: 0;
}

.ds-seg-btn {
  padding: 5px 10px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid #8b8680;
  background: #fff;
  color: #6b6459;
  margin-left: -1px;
  transition: background 0.1s, color 0.1s, border-color 0.1s;
  position: relative;
  white-space: nowrap;
}
.ds-seg-btn:first-child { border-radius: 4px 0 0 4px; margin-left: 0; }
.ds-seg-btn:last-child  { border-radius: 0 4px 4px 0; }
.ds-seg-btn:hover       { background: #f5f3f1; color: #1c1a17; z-index: 1; }
.ds-seg-btn:focus-visible {
  outline: 3px solid var(--ds-focus-ring, #1565c0);
  outline-offset: 1px;
  z-index: 2;
}

.ds-seg-btn.seg-author.active { background: #e8f5d8; border-color: #8a9b1e; color: #4a5a0a; z-index: 1; }
.ds-seg-btn.seg-proxy.active  { background: #deeeff; border-color: #5a82c8; color: #1a3a78; z-index: 1; }
.ds-seg-btn.seg-no.active     { background: #fde8e8; border-color: #c62828; color: #8b0000; z-index: 1; }

/* ── Other papers accordion ───────────────────────────────── */
.other-papers {
  border-top: 1px solid #ddd8d2;
  border-bottom: 1px solid #ddd8d2;
}
.other-papers > summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 0;
  cursor: pointer;
  font-family: "IBM Plex Sans Condensed", "IBM Plex Sans", sans-serif;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6b6459;
  user-select: none;
}
.other-papers > summary::-webkit-details-marker { display: none; }
.other-papers > summary::before {
  content: "▶";
  font-size: 9px;
  color: #b0aba6;
  transition: transform 0.15s;
  display: inline-block;
  width: 10px;
}
.other-papers[open] > summary::before { transform: rotate(90deg); }

.other-papers-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-bottom: 14px;
}
.other-papers-table th {
  font-family: "IBM Plex Sans Condensed", "IBM Plex Sans", sans-serif;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6b6459;
  background: #f0eeec;
  text-align: left;
  padding: 7px 12px;
  border-bottom: 1px solid #ddd8d2;
}
.other-papers-table td {
  padding: 8px 12px;
  border-bottom: 1px solid #f0eeec;
  color: #1c1a17;
  vertical-align: top;
}
.other-papers-table tbody tr:last-child td { border-bottom: none; }
.other-papers-table .col-id   { width: 100px; }
.other-papers-table .col-date { width: 110px; text-align: right; }

.arxiv-id-link {
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
}
td.date-cell {
  font-size: 12px;
  color: #6b6459;
  white-space: nowrap;
  text-align: right;
}

.other-papers-count {
  font-size: 11px;
  color: #b0aba6;
  font-family: "IBM Plex Sans", sans-serif;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
}

/* ── Screen-reader only ─────────────────────────────────── */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}
