:root {
  --bg: #120b10;
  --surface: #1d1219;
  --surface-2: #2a1822;
  --text: #f6eef2;
  --muted: #b9a5b0;
  --accent: #ff4d7a;
  --blurple: #5865f2;
  --line: #3a2531;
  --ok: #3ecf8e;
  --warn: #f5b942;
  --danger: #ff5c5c;
  --radius: 14px;
  color-scheme: dark;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

a { color: var(--accent); }
h1 { font-size: 26px; margin: 0 0 12px; line-height: 1.2; }
h2 { font-size: 18px; margin: 0 0 10px; }
small { font-size: 13px; }
.muted { color: var(--muted); }
.mono { font-family: ui-monospace, Consolas, monospace; }

/* Layout */
.shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 18px;
  padding: 18px 14px; background: var(--surface); border-right: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 800; text-decoration: none; }
.brand img { border-radius: 8px; }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar nav a { padding: 9px 12px; border-radius: 10px; color: var(--muted); text-decoration: none; font-weight: 600; }
.sidebar nav a:hover { background: var(--surface-2); color: var(--text); }
.sidebar nav a.active { background: var(--surface-2); color: var(--text); box-shadow: inset 3px 0 0 var(--accent); }
.me { margin-top: auto; display: flex; align-items: center; gap: 10px; padding-top: 14px; border-top: 1px solid var(--line); }
.me img { border-radius: 50%; }
.me div { flex: 1; min-width: 0; }
.me strong, .me small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me small { color: var(--muted); }
.content { padding: 28px 32px 60px; max-width: 1200px; width: 100%; }

.topbar { display: flex; justify-content: space-between; align-items: center; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.public { max-width: 820px; margin: 0 auto; padding: 32px 16px 60px; }
.foot { text-align: center; color: var(--muted); padding: 24px 16px; font-size: 13px; }

/* Components */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 16px; }
.sub { border-left: 3px solid var(--line); padding: 4px 12px; margin: 10px 0; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.inline { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.narrow { max-width: 760px; }

.btn {
  display: inline-block; padding: 10px 18px; border: 0; border-radius: 10px;
  background: var(--blurple); color: #fff; font: inherit; font-weight: 700; text-decoration: none; cursor: pointer;
}
.btn:hover { filter: brightness(1.1); }
.btn-ghost { background: var(--surface-2); color: var(--text); border: 1px solid var(--line); }
.btn-danger { background: var(--danger); }
.link { background: none; border: 0; color: var(--muted); cursor: pointer; font: inherit; padding: 0; }
.link:hover { color: var(--text); }

label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; }
input, select, textarea {
  width: 100%; padding: 9px 11px; border-radius: 9px; border: 1px solid var(--line);
  background: var(--bg); color: var(--text); font: inherit; font-weight: 400;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--blurple); outline-offset: 1px; }
.inline input, .inline select { width: auto; flex: 1; min-width: 140px; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; margin: 0; }
legend { color: var(--muted); padding: 0 6px; }

.flash { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; font-weight: 600; }
.flash-ok { background: rgba(62, 207, 142, .12); border: 1px solid rgba(62, 207, 142, .4); }
.flash-error { background: rgba(255, 92, 92, .12); border: 1px solid rgba(255, 92, 92, .45); }

.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; text-decoration: none; color: var(--text); }
.kpi strong { display: block; font-size: 28px; color: var(--accent); }
.kpi span { color: var(--muted); font-size: 13px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 13px; }
td.clip { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.tag, .status { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.tag-warn { background: rgba(245, 185, 66, .15); color: var(--warn); }
.tag-mute { background: rgba(88, 101, 242, .2); color: #a7b0ff; }
.tag-kick { background: rgba(255, 140, 66, .18); color: #ffad6b; }
.tag-ban { background: rgba(255, 92, 92, .18); color: var(--danger); }
.status-active, .status-pending { background: rgba(255, 77, 122, .15); color: var(--accent); }
.status-expired, .status-accepted { background: rgba(62, 207, 142, .15); color: var(--ok); }
.status-revoked, .status-rejected { background: rgba(185, 165, 176, .15); color: var(--muted); }

.score-1, .score-2 { color: var(--danger); }
.score-3 { color: var(--warn); }
.score-4, .score-5 { color: var(--ok); }

.filters { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.filters input { flex: 1; min-width: 200px; width: auto; }
.filters select { width: auto; }
.pager { display: flex; justify-content: space-between; margin-top: 12px; }
.tabs { display: flex; gap: 6px; margin-bottom: 14px; }
.tabs a { padding: 8px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--muted); text-decoration: none; font-weight: 600; }
.tabs a.active { color: var(--text); border-color: var(--accent); }

blockquote { margin: 10px 0; padding: 10px 14px; border-left: 3px solid var(--accent); background: var(--surface-2); border-radius: 0 10px 10px 0; }
.facts { display: grid; grid-template-columns: 150px 1fr; gap: 8px 14px; margin: 0 0 14px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.timeline { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.timeline li { padding-left: 12px; border-left: 2px solid var(--line); }

.score-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.score-row:last-child { border-bottom: 0; }
.radios { display: flex; gap: 6px; }
.radio { flex-direction: row; }
.radio input { position: absolute; opacity: 0; width: 1px; }
.radio span { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 9px; border: 1px solid var(--line); background: var(--bg); cursor: pointer; }
.radio input:checked + span { background: var(--blurple); border-color: var(--blurple); }
.radio input:focus-visible + span { outline: 2px solid var(--accent); }

.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.member-card { display: flex; gap: 12px; align-items: center; color: var(--text); text-decoration: none; margin: 0; }
.member-card img, .member-head img { border-radius: 50%; }
.member-card small { display: block; }
.member-card.is-inactive { opacity: .55; }
.member-head { display: flex; gap: 14px; align-items: center; }
.member-head h1 { margin: 0; }
.member-head p { margin: 2px 0 0; }

.docs { display: grid; grid-template-columns: 220px 1fr; gap: 16px; align-items: start; }
.doc-nav { display: flex; flex-direction: column; gap: 4px; position: sticky; top: 20px; }
.doc-nav a { padding: 7px 10px; border-radius: 8px; color: var(--muted); text-decoration: none; }
.doc-nav a.active { background: var(--surface-2); color: var(--text); }
.doc-nav a.new { color: var(--accent); margin-top: 8px; }
.prose h1 { font-size: 24px; margin-top: 8px; }
.prose h2 { font-size: 19px; margin-top: 22px; }
.prose table { margin: 12px 0; }
.prose code { background: var(--surface-2); padding: 1px 5px; border-radius: 5px; }

.hero-card { text-align: center; padding: 30px 0; }
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 24px; text-align: left; }
.choice { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .sidebar nav { flex-direction: row; flex-wrap: wrap; }
  .content { padding: 20px 16px 48px; }
  .grid-2, .docs, .choices { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .facts { grid-template-columns: 1fr; }
  .doc-nav { position: static; }
}

.template-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 16px; }
.template-card { display: flex; flex-direction: column; }
.template-card .btn { margin-top: auto; text-align: center; }
.contribution-answers h3 { font-size: 15px; margin: 22px 0 6px; }
.contribution-answers .prose { overflow-wrap: anywhere; }
.contribution-answers .prose p { white-space: pre-wrap; }
.review-note { white-space: pre-wrap; overflow-wrap: anywhere; }
.status-submitted { background: rgba(245,185,66,.15); color: var(--warn); }
.status-reviewed { background: rgba(62,207,142,.15); color: var(--ok); }
.content { min-width: 0; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* Mesa de evaluación: una lista densa, con la ficha siempre al lado. */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.workspace-kicker { font-size: 11px; letter-spacing: .12em; color: var(--muted); font-weight: 700; margin: 0 0 14px; }
.workspace-kicker a { color: inherit; }
.round-create { display: grid; grid-template-columns: minmax(180px,1fr) 180px auto; gap: 16px; align-items: end; }
.round-list { display: grid; gap: 12px; }
.round-item { display: flex; gap: 24px; align-items: center; color: var(--text); text-decoration: none; margin: 0; }
.round-item div { flex: 1; }
.round-item h2 { margin: 0 0 4px; }
.empty-round { padding: 36px 24px; color: var(--muted); }
.reception-banner { padding: 14px 18px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.shell:has(.review-workspace) { grid-template-columns: 200px minmax(0,1fr); }
.content:has(.review-workspace) { max-width: none; padding: 24px; }
.review-workspace h1 { font-size: 30px; letter-spacing: -.03em; }
.review-workspace .row-between > div > p { margin-bottom: 0; }
.round-summary { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; padding: 16px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 20px 0 14px; color: var(--muted); font-size: 13px; }
.round-summary strong { color: var(--text); }
.round-summary progress { width: 90px; height: 5px; accent-color: var(--ok); margin-left: auto; }
.reception { display: flex; gap: 8px; align-items: center; color: var(--text); }
.reception i, .process-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #a494a0; flex-shrink: 0; }
.reception.open i, .process-dot.done { background: var(--ok); }
.reception.closed i, .process-dot.pending { background: var(--warn); }
.process-dot { margin-right: 7px; }
.process-dot.reviewing { background: #a4aaff; }
.process-dot.not_evaluated { background: #997b97; }
.roster-import { padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 14px; }
.roster-import summary { cursor: pointer; font-weight: 600; }
.roster-import form { margin-top: 14px; max-width: 900px; }
.roster-import .btn { align-self: start; }
.review-filters { display: flex; gap: 8px; align-items: end; flex-wrap: wrap; margin-bottom: 16px; }
.review-filters label { min-width: 130px; flex: 1; }
.review-filters .search-field { min-width: 210px; flex: 2; }
.review-filters input, .review-filters select { min-height: 40px; font-size: 13px; }
.review-grid { display: grid; grid-template-columns: minmax(0,1fr) 420px; gap: 18px; align-items: start; }
.roster-pane { min-width: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.roster-count { display: flex; justify-content: space-between; padding: 12px 14px; color: var(--muted); font-size: 12px; border-bottom: 1px solid var(--line); }
.roster-count a { color: var(--muted); }
.roster-scroll { overflow: auto; max-height: calc(100vh - 260px); }
.board-table { font-size: 12px; width: 100%; min-width: 1170px; background: var(--bg); }
.board-table th { position: sticky; top: 0; z-index: 2; background: var(--surface); white-space: nowrap; padding: 12px; }
.board-table td { padding: 12px; white-space: nowrap; vertical-align: middle; cursor: pointer; }
.board-table td:first-child, .board-table th:first-child { position: sticky; left: 0; background: var(--bg); z-index: 1; min-width: 190px; border-right: 1px solid var(--line); }
.board-table th:first-child { z-index: 3; background: var(--surface); }
.board-table tr:hover td { background: var(--surface); }
.board-table tr.selected td { background: #30232e; }
.board-table .staff-cell a { display: block; color: var(--text); text-decoration: none; }
.staff-cell strong, .staff-cell span, .staff-cell small { display: block; }
.staff-cell strong { font-size: 14px; }
.staff-cell span { color: var(--muted); font-size: 12px; }
.staff-cell small { color: var(--muted); font-size: 10px; font-family: ui-monospace, Consolas, monospace; margin-top: 3px; }
.board-table td.clip { max-width: 200px; }
.delivery-tag { border: 1px solid var(--line); border-radius: 5px; padding: 2px 6px; color: var(--muted); }
.delivery-tag.yes { color: #a0dfba; border-color: #365747; }
.evaluation-pane { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow: auto; padding: 20px; min-width: 0; }
.evaluation-heading { display: flex; justify-content: space-between; gap: 14px; border-bottom: 1px solid var(--line); padding-bottom: 16px; margin-bottom: 16px; }
.evaluation-heading h2 { margin: 6px 0; font-size: 24px; letter-spacing: -.03em; }
.evaluation-heading p { margin: 0; font-size: 11px; overflow-wrap: anywhere; }
.evaluation-heading > .process-dot { margin-top: 10px; }
.smart-score { background: #16181a; border: 1px solid #384246; border-radius: 12px; padding: 16px; margin-bottom: 24px; }
.smart-score > div:first-child { display: grid; grid-template-columns: 1fr auto; align-items: center; }
.smart-score > div > span { font-size: 12px; color: #bdc8cc; }
.smart-score > div > strong { grid-row: span 2; font-size: 36px; line-height: 1; color: #d5e9df; letter-spacing: -.05em; }
.smart-score > div > strong small { font-size: 13px; font-weight: 400; letter-spacing: 0; }
.smart-score p { font-size: 12px; color: #bdc8cc; }
.smart-score summary { font-size: 12px; cursor: pointer; color: #d5e9df; }
.rubric-row { padding: 10px 0; border-bottom: 1px solid #30383b; }
.rubric-row strong { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; }
.rubric-row small { display: block; color: #bdc8cc; font-size: 11px; margin-top: 4px; }
.review-signals { font-size: 12px; color: #dfcdab; padding-left: 18px; margin-bottom: 0; }
.review-signals li { margin-top: 8px; }
.score-empty { font-size: 13px; color: var(--muted); padding: 16px; border: 1px dashed var(--line); border-radius: 10px; margin-bottom: 24px; }
.answer-stack { margin: 0 0 24px; }
.answer-stack > h3, .evaluation-editor > h3 { font-size: 14px; margin: 0 0 12px; }
.answer-template { border: 1px solid var(--line); border-radius: 8px; margin: 0 0 10px; padding: 12px; }
.answer-template > summary { cursor: pointer; font-size: 13px; }
.answer-template > summary small { display: block; color: var(--muted); font-weight: 400; font-size: 10px; margin-top: 5px; }
.answer-section { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 10px; }
.answer-section > summary { display: flex; justify-content: space-between; gap: 8px; cursor: pointer; color: var(--muted); font-size: 12px; }
.answer-section small { font-size: 10px; }
.answer-field h4 { margin: 16px 0 5px; font-size: 12px; }
.answer-field .prose { font-size: 13px; white-space: pre-wrap; overflow-wrap: anywhere; }
.answer-field .prose p { margin: 5px 0; }
.answer-source { display: inline-block; font-size: 11px; margin-top: 14px; }
.evaluation-editor { border-top: 1px solid var(--line); padding-top: 20px; }
.evaluation-editor label { font-size: 12px; }
.evaluation-editor .check-label { display: flex; flex-direction: row; align-items: center; gap: 9px; font-weight: 400; }
.check-label input { width: 16px; height: 16px; accent-color: var(--blurple); flex-shrink: 0; }
.outcome-options { display: flex; flex-wrap: wrap; gap: 10px 16px; }
.outcome-options legend { font-size: 12px; }
.evaluation-save { display: flex; gap: 8px; flex-wrap: wrap; position: sticky; bottom: -20px; padding: 12px 0; background: var(--surface); }
.evaluation-save .btn { font-size: 12px; flex: 1; padding: 10px; white-space: nowrap; }
@media (max-width: 1250px) {
  .review-grid { grid-template-columns: 1fr; }
  .roster-scroll { max-height: 460px; }
  .evaluation-pane { position: static; max-height: none; }
  .evaluation-editor { max-width: 700px; }
}
@media (max-width: 900px) {
  .shell:has(.review-workspace) { grid-template-columns: 1fr; }
  .content:has(.review-workspace) { padding: 20px 16px 48px; }
  .round-create { grid-template-columns: 1fr; }
  .round-item { flex-wrap: wrap; gap: 12px; }
  .round-summary { gap: 12px; }
  .round-summary progress { margin-left: 0; }
}

.ficha-tabs { display: flex; gap: 6px; position: sticky; top: -20px; z-index: 4; background: var(--surface); padding: 10px 0 14px; margin-bottom: 6px; }
.ficha-tabs a { padding: 5px 10px; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); text-decoration: none; font-size: 12px; }
.ficha-tabs a:hover { color: var(--text); border-color: var(--muted); }
#round-answers, #round-evaluation, #round-score { scroll-margin-top: 60px; }
.smart-score > small { display: block; font-size: 10px; color: #bdc8cc; margin-top: 12px; }

.discord-banner { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:16px 18px; border:1px solid #36454b; border-radius:12px; background:#151c20; margin:16px 0; }
.discord-banner strong { font-size:13px; color:#d4e5e9; }
.discord-banner p { margin:5px 0 0; color:#b5c8ce; font-size:12px; }
.discord-banner .btn { white-space:nowrap; font-size:12px; }
.role-chips { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:18px; }
.role-chips span { padding:4px 10px; border:1px solid var(--line); border-radius:6px; font-size:12px; color:var(--muted); }
.integration-status p { margin-bottom:12px; }
@media(max-width:600px) { .discord-banner { align-items:flex-start; flex-direction:column; } }
