/* ── Layout ─────────────────────────────────────────────── */
.narrativas-main {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 1.5rem 4rem;
}

.nv-hero {
  padding: 2.5rem 0 1.5rem;
}


/* ── Setup warning ───────────────────────────────────────── */
.setup-warning {
  background: rgba(245,197,24,0.08);
  border: 1px solid rgba(245,197,24,0.3);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 2rem;
}
.setup-inner h3 { margin: 0 0 0.75rem; color: var(--accent); }
.setup-inner ol { padding-left: 1.2rem; color: var(--muted); line-height: 2; }
.setup-inner code {
  background: rgba(255,255,255,0.07);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  font-size: 0.88em;
  color: var(--accent);
}
.setup-inner a { color: var(--green); }

/* ── Filter bar ──────────────────────────────────────────── */
.nv-filter-bar {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}
.filter-btn {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  padding: 0.35rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
}
.filter-btn:hover { border-color: var(--accent); color: var(--text); }
.filter-btn.active {
  background: rgba(245,197,24,0.12);
  border-color: rgba(245,197,24,0.45);
  color: var(--accent);
}

/* ── Sort bar ────────────────────────────────────────────── */
.nv-sort-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.sort-btn {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  padding: 0.3rem 0.8rem;
  font-size: 0.82rem;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
}
.sort-btn:hover { border-color: var(--accent); color: var(--text); }
.sort-btn.active {
  background: rgba(245,197,24,0.12);
  border-color: rgba(245,197,24,0.45);
  color: var(--accent);
  font-weight: 700;
}

/* ── Loading ─────────────────────────────────────────────── */
.nv-loading {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 3rem;
  justify-content: center;
}
.nv-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Grid de cards ───────────────────────────────────────── */
.nv-grid {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

/* ── Card de votación ────────────────────────────────────── */
.narrativa-voto-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem 1.3rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.narrativa-voto-card:hover {
  border-color: rgba(245,197,24,0.25);
  box-shadow: 0 4px 24px rgba(0,0,0,0.25);
}

.nv-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.nv-fecha { font-size: 0.78rem; color: var(--muted); }

.nv-fecha-propuesta {
  font-size: 0.78rem;
  color: var(--muted);
}

.nv-texto {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.4;
  color: var(--text);
}

.nv-descripcion {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.55;
  color: #9aa3b5;
}

/* ── Criterio de resolución ──────────────────────────────── */
.nv-criterio {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.6rem 0.85rem;
  background: rgba(245,197,24,0.05);
  border: 1px solid rgba(245,197,24,0.2);
  border-radius: 10px;
  font-size: 0.85rem;
  line-height: 1.5;
}
.nv-criterio-label {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: var(--accent);
  text-transform: uppercase;
}
.nv-criterio-text {
  color: #c8cedb;
}

.nv-fuente {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--green);
  text-decoration: none;
  background: rgba(0,214,143,0.08);
  border: 1px solid rgba(0,214,143,0.25);
  border-radius: 999px;
  padding: 0.25rem 0.7rem;
  width: fit-content;
  transition: background 0.15s;
}
.nv-fuente:hover {
  background: rgba(0,214,143,0.16);
}

/* Reutiliza .prob-bar y .prob-fill de styles.css */
.nv-bar-wrap { display: flex; flex-direction: column; gap: 0.3rem; }
.nv-bar-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  font-weight: 700;
}

.nv-votos-total {
  font-size: 0.82rem;
  font-weight: 600;
  color: #c8cedb;
}

/* ── Acciones ────────────────────────────────────────────── */
.nv-actions { display: flex; gap: 0.6rem; align-items: center; }

.nv-btn {
  flex: 1;
  padding: 0.55rem 0.5rem;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.9rem;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  border: none;
}
.nv-btn:active { transform: scale(0.97); }
.nv-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.nv-ya-votado {
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.45rem 0.9rem;
  border-radius: 8px;
}

/* ── Narrativa resuelta ──────────────────────────────────── */
.narrativa-voto-card.card-resuelta {
  opacity: 0.82;
  border-color: rgba(255,255,255,0.06);
}
.narrativa-tag.tag-confirmada {
  background: rgba(0,214,143,0.15);
  color: var(--green);
  border: 1px solid rgba(0,214,143,0.35);
}
.narrativa-tag.tag-refutada {
  background: rgba(255,85,119,0.12);
  color: var(--red);
  border: 1px solid rgba(255,85,119,0.3);
}

.nv-resuelta-banner {
  width: 100%;
  padding: 0.55rem 0.9rem;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 700;
  text-align: center;
}
.nv-confirmada {
  background: rgba(0,214,143,0.1);
  color: var(--green);
  border: 1px solid rgba(0,214,143,0.25);
}
.nv-refutada {
  background: rgba(255,85,119,0.08);
  color: var(--red);
  border: 1px solid rgba(255,85,119,0.2);
}

/* ── Navbar active ───────────────────────────────────────── */
.nav-active {
  color: var(--accent) !important;
  font-weight: 700;
}

/* ── Ban banner ──────────────────────────────────────────── */
.ban-banner {
  background: rgba(255,85,119,0.1);
  border: 1px solid rgba(255,85,119,0.35);
  border-radius: var(--radius);
  color: var(--red);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.85rem 1.2rem;
  margin: 0.5rem 0 1.5rem;
  text-align: center;
}

/* ── CTA login ───────────────────────────────────────────── */
.nv-cta-login {
  text-align: center;
  padding: 1rem 0 1.5rem;
}

/* ── Controls wrapper ────────────────────────────────────── */
.nv-controls {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 1.25rem;
}
.nv-grid-section { margin-top: 0.5rem; }

/* ── Author + meta row ───────────────────────────────────── */
.nv-meta-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.nv-autor {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  background: rgba(245,197,24,0.08);
  border: 1px solid rgba(245,197,24,0.2);
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
}

/* ── Tags / badges ───────────────────────────────────────── */
.narrativa-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  white-space: nowrap;
}
.tag-abierta {
  background: rgba(255,255,255,0.06);
  color: var(--muted);
  border: 1px solid var(--border);
}
.tag-caliente {
  background: rgba(255,140,0,0.12);
  color: #ff8c00;
  border: 1px solid rgba(255,140,0,0.3);
}
.tag-epica {
  background: rgba(245,197,24,0.12);
  color: var(--accent);
  border: 1px solid rgba(245,197,24,0.3);
}
.tag-vencida {
  background: rgba(255,255,255,0.06);
  color: var(--muted);
  border: 1px solid var(--border);
}

/* ── Vote state ──────────────────────────────────────────── */
.nv-ya-votado {
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.45rem 0.9rem;
  border-radius: 8px;
  flex-shrink: 0;
}
.nv-ya-votado.position-si {
  background: rgba(0,214,143,0.1);
  color: var(--green);
  border: 1px solid rgba(0,214,143,0.3);
}
.nv-ya-votado.position-no {
  background: rgba(255,85,119,0.1);
  color: var(--red);
  border: 1px solid rgba(255,85,119,0.3);
}

/* ── Vencida banner ──────────────────────────────────────── */
.nv-vencida-banner {
  width: 100%;
  padding: 0.55rem 0.9rem;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
  background: rgba(255,255,255,0.04);
  color: var(--muted);
  border: 1px solid var(--border);
}

/* ── Vote timer ──────────────────────────────────────────── */
.voto-timer {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;
}
.timer-seg {
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

/* ── Admin/author actions ────────────────────────────────── */
.nv-admin-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding-top: 0.3rem;
  border-top: 1px solid var(--border);
}
.nv-admin-btn {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.4rem 0.9rem;
  transition: all 0.15s;
}
.nv-admin-btn:hover { border-color: var(--accent); color: var(--text); }
.nv-admin-btn.btn-danger { color: var(--red); }
.nv-admin-btn.btn-danger:hover {
  background: rgba(255,85,119,0.1);
  border-color: rgba(255,85,119,0.4);
}

/* ── Form (nueva narrativa) ──────────────────────────────── */
.nv-form-section { margin-bottom: 1rem; }
.nv-form-details {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.nv-form-details summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.85rem 1.2rem;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  user-select: none;
  border-radius: var(--radius);
  transition: background 0.15s;
}
.nv-form-details summary:hover { background: rgba(255,255,255,0.03); }
.nv-form-details summary::-webkit-details-marker { display: none; }
.nv-form-details[open] summary { border-bottom: 1px solid var(--border); border-radius: var(--radius) var(--radius) 0 0; }

.nv-form {
  padding: 0;
}
.nv-form-inner {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  padding: 1.2rem;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.field label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
}
.field input,
.field select,
.field textarea {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.92rem;
  padding: 0.55rem 0.8rem;
  outline: none;
  transition: border-color 0.15s;
  resize: vertical;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: rgba(245,197,24,0.5);
}
.field select option { background: var(--bg-elev-2); }
.field-row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.field-row .field { flex: 1; min-width: 0; }
.char-hint {
  font-size: 0.75rem;
  color: var(--muted);
  text-align: right;
}
.req { color: var(--red); }
.nv-form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding-top: 0.25rem;
}
.muted { color: var(--muted); }
.small { font-size: 0.82rem; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 600px) {
  .nv-form-footer { flex-direction: column; align-items: stretch; }
  .nv-form-footer .btn { width: 100%; }
  .nv-admin-actions { gap: 0.4rem; }
  .nv-admin-btn { flex: 1; text-align: center; }
  .nv-header { flex-direction: column; align-items: flex-start; }
  .narrativas-main { padding: 0 1rem 3rem; }
}
