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

/* ── Tokens ────────────────────────────────────────────────────────────── */
:root {
  --azul:        #1a1a2e;
  --rojo:        #b91c1c;
  --verde:       #16a34a;
  --amber:       #d97706;
  --gris:        #6b7280;
  --borde:       #e5e7eb;
  --fondo:       #f1f5f9;
  --superficie:  #ffffff;
  --texto:       #111827;
  --muted:       #6b7280;
  --radio:       10px;
  --radio-pill:  999px;
  --radio-card:  12px;
  --gap-card:    24px;
  --pad-card:    24px;
  --max-content: 860px;

  /* aliases de compatibilidad */
  --surface: var(--superficie);
  --border:  var(--borde);
  --error:   var(--rojo);
}

/* ── Base ──────────────────────────────────────────────────────────────── */
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--fondo);
  color: var(--texto);
  font-size: 16px;
  line-height: 1.5;
  padding-bottom: 40px;
}

body.app-body {
  padding-bottom: 0;
  display: flex;
}

/* ── Sidebar ───────────────────────────────────────────────────────────── */
.sidebar {
  width: 220px;
  min-width: 220px;
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  background: var(--azul);
  color: white;
  display: flex;
  flex-direction: column;
  z-index: 20;
  overflow-y: auto;
}

.sidebar-logo {
  padding: 20px 16px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar-logo-link {
  color: white;
  text-decoration: none;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -.3px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  padding: 8px 8px 0;
  gap: 2px;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  color: rgba(255,255,255,0.65);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: background .12s, color .12s;
}
.sidebar-item:hover  { background: rgba(255,255,255,0.08); color: white; }
.sidebar-item.active { background: rgba(255,255,255,0.14); color: white; }

.sidebar-icon  { font-size: 16px; flex-shrink: 0; }
.sidebar-label { flex: 1; }

.sidebar-badge {
  background: #ef4444;
  color: white;
  font-size: 11px;
  font-weight: 700;
  border-radius: 10px;
  padding: 1px 6px;
  min-width: 18px;
  text-align: center;
  line-height: 16px;
}
.sidebar-badge:empty { display: none; }
.sidebar-badge-live  { background: var(--verde); }

.sidebar-divider {
  height: 1px;
  background: rgba(255,255,255,0.08);
  margin: 10px 16px;
}

.sidebar-spacer { flex: 1; }

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid rgba(255,255,255,0.08);
  text-decoration: none;
  color: rgba(255,255,255,0.75);
  font-size: 13px;
  font-weight: 500;
  transition: background .12s;
}
.sidebar-user:hover  { background: rgba(255,255,255,0.08); color: white; }
.sidebar-user.active { background: rgba(255,255,255,0.14); color: white; }

.sidebar-user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255,255,255,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}
.sidebar-user-img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.sidebar-user-name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.sidebar-logout {
  display: block;
  width: calc(100% - 32px);
  margin: 8px 16px 12px;
  padding: 8px;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--radio-pill);
  color: rgba(255,255,255,0.5);
  font-size: 12px;
  cursor: pointer;
  text-align: center;
  transition: background .12s, color .12s;
  text-decoration: none;
}
.sidebar-logout:hover {
  background: rgba(255,80,80,0.15);
  border-color: rgba(255,80,80,0.4);
  color: #ff8080;
}

/* ── Layout principal ──────────────────────────────────────────────────── */
.main-content {
  margin-left: 220px;
  min-height: 100vh;
  width: calc(100% - 220px);
}

.page-header {
  padding: 20px 24px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: calc(var(--max-content) + 48px);
}

.page-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--texto);
}

.page-body {
  padding: 20px 24px;
  max-width: calc(var(--max-content) + 48px);
  display: flex;
  flex-direction: column;
  gap: var(--gap-card);
}

/* ── Cards ─────────────────────────────────────────────────────────────── */
.card {
  background: var(--superficie);
  border-radius: var(--radio-card);
  border: 1px solid var(--borde);
  padding: var(--pad-card);
}

/* Header de sección dentro de card: LABEL + CTA */
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

/* Label uppercase — versión simple */
.section-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Label uppercase — versión con nombre dinámico (más prominente) */
.section-label-bold {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--texto);
}

/* ── Botones ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: var(--radio-pill);
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: opacity .15s, background .12s;
  white-space: nowrap;
  line-height: 1;
}
.btn:active { opacity: .8; }

.btn-primary   { background: var(--azul);      color: white; }
.btn-secondary { background: var(--superficie); color: var(--texto); border: 1px solid var(--borde); }
.btn-danger    { background: var(--rojo);       color: white; }
.btn-danger-outline { background: var(--superficie); color: var(--rojo); border: 1px solid var(--rojo); }

.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-md { padding: 10px 18px; font-size: 14px; }
.btn-lg { padding: 14px 24px; font-size: 16px; width: 100%; }

/* Botón ghost (icon-only, copy, toggle) */
.btn-ghost {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: .5;
  transition: opacity .15s;
}
.btn-ghost:hover { opacity: 1; }

/* ── Inputs y formularios ───────────────────────────────────────────────── */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="url"],
textarea,
select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  font-size: 15px;
  font-family: inherit;
  background: var(--superficie);
  color: var(--texto);
  -webkit-appearance: none;
  transition: border-color .15s;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--azul);
}
textarea { resize: vertical; min-height: 180px; line-height: 1.6; }

/* Textarea Tipo 1 — editable directo (estándar, hereda estilos arriba) */

/* Textarea Tipo 2 — modo lectura (requiere click en Editar) */
.textarea-display {
  background: #f8fafc;
  color: var(--texto);
  cursor: default;
  border-color: var(--borde);
  resize: none;
}
.textarea-display:focus { border-color: var(--borde); }

/* Textarea Tipo 2 — modo edición (tras click en Editar) */
.textarea-display.editable {
  background: var(--superficie);
  cursor: text;
  resize: vertical;
}
.textarea-display.editable:focus { border-color: var(--azul); }

/* Contenedor para textarea Tipo 2 con copy button */
.textarea-wrapper {
  position: relative;
}
.textarea-wrapper .btn-copy {
  position: absolute;
  top: 8px;
  right: 8px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: .45;
  transition: opacity .15s;
  color: var(--gris);
}
.textarea-wrapper .btn-copy:hover { opacity: 1; }

.campo { display: flex; flex-direction: column; gap: 6px; }
.campo label { font-size: 13px; font-weight: 600; color: var(--gris); }
.campo small  { font-weight: 400; }
.contador { font-size: 12px; color: var(--gris); text-align: right; }

.form { display: flex; flex-direction: column; gap: 16px; }

.slug-preview { display: flex; align-items: center; }
.slug-base {
  background: #f3f4f6;
  border: 1px solid var(--borde);
  border-right: none;
  border-radius: var(--radio) 0 0 var(--radio);
  padding: 10px;
  font-size: 13px;
  color: var(--gris);
  white-space: nowrap;
}
.slug-preview input { border-radius: 0 var(--radio) var(--radio) 0; }

/* ── Tabs de filtro (estilo pill) ───────────────────────────────────────── */
.filter-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.filter-tab {
  background: none;
  border: 1px solid var(--borde);
  border-radius: var(--radio-pill);
  padding: 5px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  transition: background .12s, color .12s, border-color .12s;
}
.filter-tab:hover  { border-color: var(--azul); color: var(--texto); }
.filter-tab.active {
  background: var(--azul);
  border-color: var(--azul);
  color: white;
  font-weight: 600;
}

/* Tabs de navegación (línea inferior — usado en cola de revisión) */
.tabs {
  display: flex;
  border-bottom: 2px solid var(--borde);
  background: white;
  padding: 0 16px;
  gap: 4px;
  position: sticky;
  top: 0;
  z-index: 10;
}
.tab {
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  margin-bottom: -2px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.tab.active { color: var(--texto); border-bottom-color: var(--azul); }
.tab-badge {
  background: #ef4444;
  color: white;
  font-size: 11px;
  font-weight: 700;
  border-radius: 10px;
  padding: 1px 6px;
  min-width: 18px;
  text-align: center;
}
.tab-badge:empty { display: none; }

/* ── Badges de estado ───────────────────────────────────────────────────── */
.badge-estado {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: var(--radio-pill);
}
.badge-borrador  { color: var(--amber);  background: #fffbeb; }
.badge-publicado { color: var(--verde);  background: #f0fdf4; }
.badge-alerta    { color: var(--amber);  background: #fffbeb; }
.badge-evergreen { color: #1d4ed8;       background: #eff6ff; }

/* Badge genérico (score, fuente) */
.badge {
  display: inline-block;
  border-radius: var(--radio-pill);
  padding: 2px 10px;
  font-size: 12px;
  font-weight: 600;
}
.badge-alta  { background: #fef2f2; color: var(--rojo); }
.badge-media { background: #fffbeb; color: var(--amber); }

/* ── Estado vacío (dashed) ──────────────────────────────────────────────── */
.empty-state {
  border: 1.5px dashed #cbd5e1;
  border-radius: var(--radio-card);
  padding: 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  background: #f8fafc;
}

/* ── Estados globales ───────────────────────────────────────────────────── */
.loading, .vacio, .error-msg { padding: 40px 16px; text-align: center; color: var(--gris); }
.error-msg { color: var(--rojo); }

.mensaje {
  padding: 12px 16px;
  border-radius: var(--radio);
  font-weight: 600;
  text-align: center;
  font-size: 14px;
}
.mensaje.exito { background: #f0fdf4; color: var(--verde); }
.mensaje.error  { background: #fef2f2; color: var(--rojo); }

/* ── Modal ──────────────────────────────────────────────────────────────── */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 16px;
}
.modal.visible { display: flex; }
.modal-box {
  background: white;
  border-radius: var(--radio-card);
  padding: 24px 20px;
  max-width: 360px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.modal-pregunta { font-size: 17px; font-weight: 700; line-height: 1.4; }
.modal-aviso    { font-size: 14px; color: var(--gris); }
.modal-acciones { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }

/* ── Tabla genérica (secciones, etiquetas, etc.) ────────────────────────── */
.tabla {
  width: 100%;
  border-collapse: collapse;
}
.tabla th {
  text-align: left;
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
  border-bottom: 1px solid var(--borde);
}
.tabla td {
  padding: 12px;
  font-size: 14px;
  border-bottom: 1px solid var(--borde);
  vertical-align: middle;
}
.tabla tr:last-child td { border-bottom: none; }
.tabla-acciones { display: flex; gap: 6px; justify-content: flex-end; }

/* ── Tabla fuentes (scraper) ────────────────────────────────────────────── */
.tabla-fuentes { width: 100%; border-collapse: collapse; }
.tabla-fuentes th { text-align: left; padding: 12px 14px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); border-bottom: 1px solid var(--borde); }
.tabla-fuentes td { padding: 12px 14px; font-size: 14px; border-bottom: 1px solid var(--borde); vertical-align: middle; }
.tabla-fuentes tr:last-child td { border-bottom: none; }
.fila-inactiva   { opacity: .55; }
.fuente-nombre   { font-weight: 600; }
.fuente-url      { font-size: 12px; color: var(--gris); margin-top: 2px; word-break: break-all; }
.tag-tipo        { background: #f3f4f6; color: var(--gris); font-size: 12px; padding: 2px 8px; border-radius: 6px; font-weight: 600; }
.toggle-activa   { border: none; background: none; cursor: pointer; font-size: 13px; font-weight: 600; padding: 4px 10px; border-radius: var(--radio-pill); }
.toggle-activa.activa   { color: var(--verde);  background: #f0fdf4; }
.toggle-activa.inactiva { color: var(--gris);   background: #f3f4f6; }
.acciones-fuente { display: flex; gap: 6px; }

/* ── Lista de artículos ─────────────────────────────────────────────────── */
.article-list { display: flex; flex-direction: column; }
.article-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--borde);
  text-decoration: none;
  color: var(--texto);
}
.article-row:last-child { border-bottom: none; }
.article-row:hover .article-title { text-decoration: underline; }
.article-title { flex: 1; font-size: 14px; font-weight: 500; line-height: 1.4; }
.article-fecha { font-size: 12px; color: var(--muted); white-space: nowrap; }

/* ── Lista de editores (equipo) ─────────────────────────────────────────── */
.editor-list { display: flex; flex-direction: column; }
.editor-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--borde);
}
.editor-row:last-child { border-bottom: none; }
.editor-avatar-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--azul);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}
.editor-info { flex: 1; min-width: 0; }
.editor-nombre { font-size: 14px; font-weight: 600; }
.editor-email  { font-size: 12px; color: var(--muted); }
.badge-rol {
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: var(--radio-pill);
  border: 1px solid var(--borde);
  color: var(--texto);
  background: transparent;
}
.badge-rol-jefe { border-color: var(--azul); color: var(--azul); }

/* ── Fuente bloque (paso 2 scraper / editorial) ─────────────────────────── */
.fc-bloque { border: 1px solid var(--borde); border-radius: 8px; overflow: hidden; margin-bottom: .75rem; }
.fc-bloque:last-child { margin-bottom: 0; }
.fc-header { display: flex; align-items: center; gap: .75rem; padding: .7rem 1rem; background: #f9fafb; border-bottom: 1px solid var(--borde); }
.fc-header-label { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--texto); flex: 1; min-width: 0; }
.fc-toggle { background: none; border: none; cursor: pointer; font-size: .75rem; color: var(--gris); padding: 2px 6px; border-radius: 4px; white-space: nowrap; }
.fc-toggle:hover { background: var(--borde); }
.fc-body { position: relative; }
.fc-textarea { width: 100%; border: none; resize: vertical; font-size: .85rem; line-height: 1.6; color: var(--texto); padding: .85rem 2.5rem .85rem 1rem; font-family: inherit; background: #fff; min-height: 80px; max-height: 220px; overflow-y: auto; display: block; }
.fc-textarea:focus { outline: none; }
.fc-copy { position: absolute; top: .6rem; right: .6rem; background: none; border: 1px solid var(--borde); border-radius: 5px; cursor: pointer; padding: 3px 6px; color: var(--gris); display: flex; align-items: center; justify-content: center; }
.fc-copy:hover { background: var(--borde); }

/* ── Fuentes (alerta paso 1) ────────────────────────────────────────────── */
.fuentes { display: flex; flex-direction: column; gap: 2px; margin-bottom: 28px; }
.fuentes h3 { font-size: 11px; font-weight: 700; color: var(--gris); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 8px; }
.fuentes-secundarias-label { font-size: 11px; font-weight: 700; color: var(--gris); text-transform: uppercase; letter-spacing: .08em; margin-top: 12px; margin-bottom: 4px; }
.fuente-no-encontrada { font-size: 13px; color: var(--gris); font-style: italic; padding: 4px 0; }
.fuente-link { display: flex; align-items: baseline; gap: 8px; text-decoration: none; color: var(--texto); font-size: 13.5px; line-height: 1.4; padding: 7px 0; }
.fuente-link:hover { color: var(--azul); }
.fuente-link:hover .fuente-titulo { text-decoration: underline; }
.fuente-ext { font-size: 11px; color: var(--gris); flex-shrink: 0; }
.fuente-label { font-size: 11px; font-weight: 700; color: var(--gris); background: var(--fondo); border: 1px solid var(--borde); border-radius: 4px; padding: 1px 6px; white-space: nowrap; flex-shrink: 0; }
.fuente-label-primaria { color: #1d4ed8; background: #eff6ff; border-color: #bfdbfe; }
.fuente-label-original { color: #92400e; background: #fffbeb; border-color: #fde68a; }
.fuente-titulo { color: var(--texto); }

.fuente-grupo { padding: .75rem 0; border-bottom: 1px solid var(--borde); }
.fuente-grupo:last-child { border-bottom: none; }
.fuente-grupo-label { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--gris); margin-bottom: .75rem; }
.fuente-item { display: flex; align-items: flex-start; gap: .75rem; padding: .6rem .75rem; border-radius: 6px; background: #fff; border: 1px solid var(--borde); margin-bottom: .5rem; }
.fuente-item:last-child { margin-bottom: 0; }
.fuente-item input[type=checkbox] { margin-top: 3px; flex-shrink: 0; accent-color: var(--azul); width: 16px; height: 16px; cursor: pointer; }
.fuente-item-body { flex: 1; min-width: 0; }
.fuente-item-url { font-size: .8rem; color: var(--azul); text-decoration: none; display: block; margin-bottom: .3rem; word-break: break-all; font-weight: 600; }
.fuente-item-url:hover { text-decoration: underline; }
.fuente-item-snippet { font-size: .82rem; color: var(--gris); line-height: 1.45; margin: 0; }
.fuente-item-tipo { font-size: .75rem; color: var(--gris); margin-bottom: .2rem; }
.fuente-seccion-wrapper { border: 1px solid var(--borde); border-radius: 8px; padding: .75rem 1rem; margin-bottom: 1.25rem; }

/* ── Alerta header ──────────────────────────────────────────────────────── */
.alerta-card { background: white; border-radius: var(--radio-card); padding: 16px; border: 1px solid var(--borde); display: flex; gap: 12px; align-items: flex-start; }
.alerta-card-body { flex: 1; min-width: 0; }
.alerta-meta { display: flex; justify-content: space-between; align-items: center; }
.alerta-header { display: flex; align-items: center; gap: 1rem; padding: .75rem 1rem; background: #fff; border: 1px solid var(--borde); border-radius: 8px; margin-bottom: 1.5rem; flex-wrap: wrap; }
.alerta-header-fuente { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--azul); }
.alerta-header-score  { font-size: .75rem; font-weight: 600; padding: .2rem .6rem; background: #f0fdf4; color: #15803d; border-radius: 20px; }
.alerta-header-fecha  { font-size: .75rem; color: var(--gris); margin-left: auto; }
.alerta-titular       { font-size: 1.3rem; font-weight: 700; line-height: 1.35; margin-bottom: 1.5rem; color: var(--texto); }
.alerta-extracto { font-size: .85rem; color: var(--muted); margin: .35rem 0 .6rem; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.alerta-check { accent-color: var(--azul); width: 18px; height: 18px; cursor: pointer; flex-shrink: 0; margin-top: 3px; }

/* Mensaje global (notificación flash) */
.mensaje-global { background: #7e22ce; color: #fff; padding: .6rem 1rem; border-radius: 6px; font-size: .85rem; margin: 0 0 12px; }

/* Tabs sin sticky (override para páginas con layout propio) */
.tabs-static { position: static; padding: 0; margin-bottom: 16px; }

/* Lista sin padding (override cuando el contenedor ya tiene padding) */
.lista-flush { padding: 0; }

/* ── Stepper ────────────────────────────────────────────────────────────── */
.step         { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.step-circle  { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: .8rem; font-weight: 700; border: 2px solid var(--borde); background: #fff; color: var(--gris); }
.step-circle.activo     { border-color: var(--azul);  background: var(--azul);  color: #fff; }
.step-circle.completado { border-color: var(--verde); background: var(--verde); color: #fff; }
.step-label   { font-size: .75rem; color: var(--gris); white-space: nowrap; }
.step-label.activo { color: var(--azul); font-weight: 600; }
.step-line    { flex: 1; height: 2px; background: var(--borde); margin: 0 4px; margin-bottom: 16px; }
.step-line.completado { background: var(--verde); }

/* ── Titulares (radio) ──────────────────────────────────────────────────── */
.titular-radio-item { display: flex; align-items: flex-start; gap: .6rem; padding: .55rem .75rem; border-radius: 6px; border: 1px solid var(--borde); background: #fff; cursor: pointer; transition: border-color .15s, background .15s; }
.titular-radio-item:hover       { border-color: #93c5fd; background: #f8faff; }
.titular-radio-item.seleccionado { border-color: var(--azul); background: #f0f4ff; }
.titular-radio-texto { font-size: .9rem; line-height: 1.45; color: var(--texto); }

/* ── Acordeones ─────────────────────────────────────────────────────────── */
.acc-panel  { border: 1px solid var(--borde); border-radius: 8px; overflow: hidden; }
.acc-header { width: 100%; display: flex; align-items: center; justify-content: space-between; padding: .85rem 1rem; background: var(--azul); color: white; border: none; cursor: pointer; font-size: .9rem; gap: .5rem; }
.acc-header:hover { background: #16213e; }
.acc-arrow  { color: rgba(255,255,255,0.65); font-size: .8rem; margin-left: auto; }
.acc-check  { color: #4ade80; display: none; }
.acc-body   { padding: 1rem; }

/* ── Perfil editor (dropdown header) ───────────────────────────────────── */
.editor-perfil { position: relative; }
.editor-perfil-btn { display: flex; align-items: center; gap: 8px; background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.25); color: white; font-size: 13px; padding: 4px 10px 4px 6px; border-radius: var(--radio-pill); cursor: pointer; }
.editor-perfil-btn:hover { background: rgba(255,255,255,0.2); }
.editor-avatar    { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.editor-avatar-inicial { display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,0.3); font-weight: 600; font-size: 13px; }
.editor-dropdown { position: absolute; right: 0; top: calc(100% + 6px); background: white; border: 1px solid var(--borde); border-radius: 8px; box-shadow: 0 4px 16px rgba(0,0,0,0.12); min-width: 160px; overflow: hidden; z-index: 100; }
.editor-dropdown-item { display: block; width: 100%; padding: 10px 14px; text-align: left; font-size: 14px; color: var(--texto); text-decoration: none; background: none; border: none; cursor: pointer; }
.editor-dropdown-item:hover { background: var(--fondo); }
.editor-dropdown-salir { color: var(--rojo); }

/* ── Chips ──────────────────────────────────────────────────────────────── */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border-radius: var(--radio-pill);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
/* palabras clave scraper */
.chip-include { background: #eff6ff; color: #1d4ed8; }
.chip-exclude { background: #fef2f2; color: var(--rojo); }
/* estado artículo */
.chip-draft     { background: #fefce8; color: #a16207; }
.chip-published { background: #f0fdf4; color: #15803d; }
.chip-evergreen { background: #eff6ff; color: #1d4ed8; }
.chip-short     { background: #fdf4ff; color: #7e22ce; }
.chip-alerta    { background: #fff7ed; color: #c2410c; }

/* Separador vertical entre grupos de filtros */
.filter-divider {
  width: 1px;
  background: var(--borde);
  margin: 0 4px;
  align-self: stretch;
}

/* Paginación */
.paginacion {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  margin-top: 1.5rem;
}
.paginacion-info { font-size: .85rem; color: var(--muted); }

/* Lista de artículos (articulos.astro) */
.art-lista { display: block; }
.art-fila {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 8px;
  border-bottom: 1px solid var(--borde);
  text-decoration: none;
  color: inherit;
  transition: background .1s;
  border-radius: 6px;
  margin: 0 -8px;
}
.art-fila:hover  { background: #f8fafc; }
.art-titulo {
  flex: 1;
  font-size: 14.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.art-chips { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }
.art-fecha { font-size: 12px; color: var(--muted); flex-shrink: 0; min-width: 80px; text-align: right; }

/* ── Page subtitle (bajo el page-title) ────────────────────────────────── */
.page-subtitle { color: var(--muted); font-size: .88rem; margin-top: .25rem; }

/* ── Texto secundario de encabezado de sección ──────────────────────────── */
.section-title-note { font-size: .75rem; font-weight: 400; color: var(--muted); }

/* ── Inteligencia editorial (.ia-*) ─────────────────────────────────────── */
.ia-section { margin-bottom: 2.5rem; }
.ia-section-title { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 1rem; padding-bottom: .5rem; border-bottom: 1px solid var(--borde); }
.ia-grid-modelos { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .75rem; }
.ia-modelo-campo { display: flex; flex-direction: column; gap: .3rem; }
.ia-label { font-size: .75rem; font-weight: 600; color: var(--muted); }
.ia-select { padding: .4rem .6rem; border: 1px solid var(--borde); border-radius: 6px; font-size: .85rem; background: #fff; width: auto; }
.ia-prompt-bloque { border: 1px solid var(--borde); border-radius: 8px; margin-bottom: .75rem; overflow: hidden; }
.ia-prompt-header { display: flex; justify-content: space-between; align-items: flex-start; padding: .6rem .75rem; background: #f8f9fa; border-bottom: 1px solid var(--borde); gap: .5rem; }
.ia-prompt-header-info { flex: 1; min-width: 0; }
.ia-prompt-header-actions { display: flex; gap: .4rem; align-items: center; flex-shrink: 0; }
.ia-prompt-label { font-size: .8rem; font-weight: 700; color: var(--texto); }
.ia-prompt-cuando { display: block; font-size: .72rem; color: var(--muted); margin-top: 2px; }
.ia-badge-readonly { display: inline-block; font-size: .65rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; background: #f1f5f9; color: var(--muted); border-radius: 4px; padding: 1px 6px; margin-left: .4rem; vertical-align: middle; }
.ia-textarea { display: block; width: 100%; padding: .75rem; font-size: .82rem; line-height: 1.55; font-family: 'SF Mono', 'Fira Mono', monospace; border: none; resize: none; background: #fff; min-height: 80px; max-height: 400px; box-sizing: border-box; color: var(--texto); }
.ia-textarea[readonly] { background: #fafafa; color: var(--muted); }
.ia-btn-copy { padding: .3rem .5rem; border: 1px solid var(--borde); border-radius: 5px; background: #fff; cursor: pointer; display: flex; align-items: center; color: var(--muted); font-size: .75rem; }
.ia-btn-copy:hover { background: #f1f5f9; }
.ia-btn-save { padding: .3rem .65rem; border: 1px solid var(--azul); border-radius: 5px; background: var(--azul); color: #fff; font-size: .75rem; font-weight: 600; cursor: pointer; }
.ia-btn-save:disabled { opacity: .6; cursor: default; }
.ia-btn-save:hover:not(:disabled) { opacity: .88; }
.ia-msg { min-height: 1.4rem; font-size: .82rem; margin-top: .5rem; }

/* ── Timelines lista ────────────────────────────────────────────────────── */
.tl-lista { display: block; }
.tl-fila {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 8px;
  border-bottom: 1px solid var(--borde);
  text-decoration: none;
  color: inherit;
  border-radius: 6px;
  margin: 0 -8px;
  transition: background .1s;
  text-align: left;
  width: calc(100% + 16px);
  box-sizing: border-box;
}
.tl-fila:hover { background: #f8fafc; }
.tl-titulo {
  flex: 1;
  font-size: 14.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  color: var(--texto);
}
.tl-fila:hover .tl-titulo { color: var(--azul); }
.tl-meta { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }
.tl-chip-activo   { background: #f0fdf4; color: #15803d; }
.tl-chip-inactivo { background: #f1f5f9; color: #64748b; }
.tl-entradas { font-size: 12px; color: var(--muted); white-space: nowrap; }

/* Modal ancho extendido */
.modal-box-md { max-width: 480px; }

/* Error inline en formularios */
.form-error { color: var(--rojo); font-size: .85rem; min-height: 1.2rem; }
.form-warning { color: #92400e; background: #fef3c7; border: 1px solid #fcd34d; border-radius: 6px; font-size: .82rem; padding: .4rem .75rem; margin-top: .35rem; }

/* Texto muted pequeño (estados de carga/vacío en línea) */
.text-muted-sm { color: var(--muted); font-size: .9rem; }

/* ── Utilidades ─────────────────────────────────────────────────────────── */
.fuente-label-scraper { font-size: 11px; color: var(--gris); }
.fecha { font-size: 11px; color: #9ca3af; margin-left: auto; }
.razon { font-size: 13px; color: var(--gris); }
.titular { font-size: 16px; font-weight: 600; line-height: 1.4; }
.acciones { display: flex; gap: 8px; flex-wrap: wrap; }
.lista { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
#editor { padding: 16px; display: flex; flex-direction: column; gap: 20px; }

/* Header legacy (páginas sin sidebar) */
.header { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; background: var(--azul); color: white; position: sticky; top: 0; z-index: 10; }
.logo { font-weight: 700; font-size: 18px; }
.back { color: white; text-decoration: none; font-size: 15px; }
.btn-salir { background: transparent; border: 1px solid rgba(255,255,255,0.35); color: white; font-size: 13px; padding: 4px 10px; border-radius: var(--radio-pill); cursor: pointer; }
.scraper-toggle { background: rgba(255,255,255,0.15); border: none; color: white; font-size: 18px; width: 34px; height: 34px; border-radius: 8px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.scraper-toggle.scraper-pausado { background: rgba(255,80,80,0.4); }

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Back link (nav retorno en page-header) ─────────────────────────────── */
.back-link {
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
}
.back-link:hover { color: var(--texto); }

/* ── page-body variantes de ancho ───────────────────────────────────────── */
/* 720px — nuevo short / nuevo evergreen */
.page-body-narrow { max-width: calc(720px + 48px); }
/* 480px — perfil */
.page-body-sm     { max-width: calc(480px + 48px); }
/* 680px — equipo */
.page-body-md     { max-width: calc(680px + 48px); }

/* ── Nuevo tipo (short / evergreen) intro card ──────────────────────────── */
.nuevo-tipo-intro { display: flex; flex-direction: column; gap: 12px; }
.nuevo-tipo-row   { display: flex; gap: 12px; }
.nuevo-tipo-row input { flex: 1; }

/* ── Alerta card body ───────────────────────────────────────────────────── */
.alerta-card-topic      { font-size: .95rem; display: block; margin-bottom: .35rem; }
.alerta-card-status-row { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin-bottom: .5rem; }

/* ── Toast global (feedback de acciones JS) ─────────────────────────────── */
.toast-global {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--azul);
  color: white;
  padding: 10px 20px;
  border-radius: var(--radio-pill);
  font-size: .9rem;
  z-index: 9999;
  pointer-events: none;
}

/* ── Perfil ─────────────────────────────────────────────────────────────── */
.perfil-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  text-align: center;
}
.perfil-avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: var(--azul);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  font-weight: 600;
  flex-shrink: 0;
}
.perfil-avatar-img {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
}
.perfil-info { display: flex; flex-direction: column; align-items: center; gap: .25rem; }
.perfil-nombre { font-size: 1.4rem; font-weight: 600; }
.perfil-email  { color: var(--muted); font-size: .9rem; }
.btn-full { width: 100%; }
.perfil-guardar-row { align-items: center; margin-top: .25rem; }

/* ── Equipo ─────────────────────────────────────────────────────────────── */
.modal-form-stack { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
.modal-campo-top  { margin-top: 16px; }

.editor-avatar-inactivo { background: #cbd5e1; }
.editor-nombre-inactivo { color: var(--muted); }
.editor-self-tag   { color: var(--muted); font-weight: 400; font-size: .75rem; }
.editor-inactivo-badge { font-size: .7rem; color: #94a3b8; font-weight: 500; }
.editor-ctx-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 1.1rem;
  flex-shrink: 0;
}
.editor-ctx-btn:hover { background: var(--fondo); }

/* Badge variante CTO */
.badge-rol-cto { border-color: #92400e; color: #92400e; background: #fef3c7; }

/* Menú contextual (equipo) */
.ctx-menu {
  position: fixed;
  background: white;
  border: 1px solid var(--borde);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,.12);
  z-index: 1000;
  min-width: 160px;
  padding: 4px 0;
}
.ctx-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 14px;
  font-size: .85rem;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--texto);
  transition: background .1s;
}
.ctx-item:hover { background: #f8fafc; }
.ctx-item.danger { color: var(--rojo); }
.ctx-divider { height: 1px; background: var(--borde); margin: 4px 0; }

/* Audit log */
.audit-lista { display: flex; flex-direction: column; }
.audit-fila  { display: flex; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--borde); font-size: .83rem; }
.audit-fila:last-child { border-bottom: none; }
.audit-quien  { font-weight: 600; min-width: 110px; flex-shrink: 0; color: var(--texto); }
.audit-accion { color: var(--muted); flex: 1; }
.audit-fecha  { color: var(--muted); font-size: .75rem; flex-shrink: 0; }

/* ── Breaking News ──────────────────────────────────────────────────────── */
.bn-lista { display: flex; flex-direction: column; gap: 8px; }
.bn-card {
  background: white;
  border: 1px solid var(--borde);
  border-radius: var(--radio-card);
  padding: 14px 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.bn-card.en_vivo    { border-left: 3px solid var(--verde); }
.bn-card.programada { border-left: 3px solid #2563eb; }
.bn-card.expirada   { opacity: .5; }
.bn-card.desactivada{ opacity: .5; }
.bn-info { flex: 1; min-width: 0; }
.bn-title { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.bn-body-text { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.bn-meta { display: flex; gap: 10px; align-items: center; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.bn-status { font-weight: 700; }
.bn-status.en_vivo    { color: var(--verde); }
.bn-status.programada { color: #2563eb; }
.bn-status.expirada   { color: var(--muted); }
.bn-status.desactivada{ color: var(--muted); }
.bn-acciones { display: flex; gap: 6px; flex-shrink: 0; align-items: center; }
.bn-fechas-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.bn-checkbox-row { display: flex; align-items: center; gap: 8px; }
.bn-checkbox-row input[type=checkbox] { width: auto; }
.bn-checkbox-label { font-size: 14px; color: var(--texto); font-weight: 500; }
.label-required { color: var(--rojo); }

/* ── Vista previa ───────────────────────────────────────────────────────── */
.page-header-compact { padding-bottom: 12px; }

.preview-main {
  padding: 0 24px 60px;
  max-width: 760px;
  margin: 0 auto;
}

.preview-draft-bar {
  background: var(--amber);
  color: white;
  font-size: .82rem;
  font-weight: 600;
  text-align: center;
  padding: 6px;
  letter-spacing: .04em;
}

.preview-banner {
  background: #fef3c7;
  color: #92400e;
  font-size: .8rem;
  text-align: center;
  padding: 8px 16px;
  margin-bottom: 24px;
  border-radius: 6px;
}
.preview-label {
  display: inline-block;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--azul);
  margin-bottom: 1rem;
  border: 1px solid var(--azul);
  padding: 2px 8px;
  border-radius: 4px;
}
.preview-title {
  font-size: 1.9rem;
  font-weight: 800;
  line-height: 1.2;
  margin: 0 0 .75rem;
  color: var(--texto);
}
.preview-excerpt {
  font-size: 1.05rem;
  color: var(--muted);
  line-height: 1.5;
  margin: 0 0 1.25rem;
  font-style: italic;
}
.preview-meta {
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: .8rem;
  color: var(--muted);
  margin-bottom: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--borde);
}
.preview-figura { margin: 0 0 1.5rem; }
.preview-imagen { width: 100%; border-radius: 8px 8px 0 0; aspect-ratio: 16/9; object-fit: cover; }
.preview-figcaption { font-size: .75rem; color: var(--muted); padding: 6px 10px; background: #f8f8f8; border-radius: 0 0 8px 8px; }
.preview-body {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--texto);
  white-space: pre-wrap;
}
.preview-atribucion {
  margin-top: 1.5rem;
  font-size: .85rem;
  color: var(--muted);
  border-left: 3px solid var(--borde);
  padding-left: 12px;
}
.preview-tags { margin-top: 1.5rem; display: flex; gap: 8px; flex-wrap: wrap; }
.preview-tag {
  font-size: .75rem;
  background: var(--fondo);
  color: var(--muted);
  padding: 3px 10px;
  border-radius: var(--radio-pill);
}

/* ── Editor principal (articulo/timeline) ───────────────────────────────── */
.editor-main {
  padding: 0 24px 40px;
  max-width: calc(var(--max-content) + 48px);
  display: flex;
  flex-direction: column;
  gap: var(--gap-card);
}

/* Subtítulo de campo de sección dentro del form */
.campo-section-title {
  font-size: .95rem;
  font-weight: 600;
  margin-bottom: .75rem;
  color: var(--texto);
}

/* Sección de correcciones */
.correcciones-section {
  margin-top: 2rem;
  border-top: 1px solid var(--borde);
  padding-top: 1.5rem;
}
.lista-correcciones { margin-bottom: 1rem; }
.corr-estado { font-size: .82rem; color: var(--muted); margin-top: .5rem; min-height: 1.2rem; }

/* Bullets panel */
.bullets-panel {
  margin-bottom: .75rem;
  border: 1px solid var(--borde);
  border-radius: 8px;
  padding: 1rem;
  background: #f9f9f9;
}
.bullets-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: .75rem;
}
.bullets-panel-label { font-size: .85rem; font-weight: 600; margin: 0; }

/* Tiptap toolbar */
.tiptap-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 6px 8px;
  border: 1px solid var(--borde);
  border-bottom: none;
  border-radius: 6px 6px 0 0;
  background: #f8f8f8;
}
.tiptap-btn {
  padding: 3px 8px;
  border: 1px solid var(--borde);
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
  font-size: .82rem;
}
.tiptap-btn:hover { background: var(--fondo); }
.tiptap-bold   { font-weight: 700; }
.tiptap-italic { font-style: italic; }

/* Tiptap editor area */
.tiptap-editor {
  min-height: 220px;
  border: 1px solid var(--borde);
  border-radius: 0 0 6px 6px;
  padding: 12px 14px;
  font-size: .92rem;
  line-height: 1.6;
  outline: none;
  background: var(--superficie);
}

/* Imagen destacada */
.img-zona {
  border: 1px solid var(--borde);
  border-radius: 8px;
  overflow: hidden;
}
.img-preview {
  width: 100%;
  max-height: 400px;
  object-fit: contain;
  display: block;
  background: #000;
}
.img-sin-imagen {
  display: flex;
  flex-direction: column;
  align-items: center;
  border-radius: 8px;
  padding: 2.5rem 1rem;
  text-align: center;
  gap: 1rem;
}
.img-acciones { display: flex; gap: .5rem; margin-top: .5rem; }
.img-estado { font-size: .82rem; color: var(--muted); margin-top: .25rem; min-height: 1rem; }

/* Loading inline */
.loading-inline { padding: 1rem 0; }

/* ── Timeline editor ────────────────────────────────────────────────────── */
.tl-meta-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: .75rem;
}
.tl-meta-info  { flex: 1; min-width: 0; }
.tl-meta-title-row {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin-bottom: 4px;
  flex-wrap: wrap;
}
.tl-meta-titulo { font-size: 1.15rem; font-weight: 700; margin: 0; }
.tl-form-meta {
  border-top: 1px solid var(--borde);
  padding-top: 1rem;
  margin-top: .75rem;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.tl-campo-checkbox { flex-direction: row; align-items: center; }
.tl-checkbox-label {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .88rem;
  cursor: pointer;
}
.tl-checkbox { width: 16px; height: 16px; }

/* Timeline entry list */
.tl-lista { position: relative; padding-left: 24px; border-left: 2px solid var(--borde); margin-left: 8px; }
.tl-entry { position: relative; margin-bottom: 2rem; }
.tl-dot   { position: absolute; left: -33px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--azul); border: 2px solid #fff; box-shadow: 0 0 0 2px var(--azul); }
.tl-content { padding-left: 8px; }
.tl-fecha   { font-size: .78rem; color: var(--muted); margin-bottom: .25rem; }
.tl-titular { font-size: 1rem; font-weight: 700; margin-bottom: .35rem; line-height: 1.3; }
.tl-desc    { font-size: .88rem; color: var(--texto); line-height: 1.5; margin-bottom: .4rem; }
.tl-url     { font-size: .82rem; color: var(--azul); text-decoration: none; display: inline-block; margin-bottom: .4rem; }
.tl-url:hover { text-decoration: underline; }
.tl-acciones { display: flex; gap: .4rem; margin-top: .5rem; }

/* ── Editorial page ─────────────────────────────────────────────────────── */
.editorial-cat-form {
  background: var(--fondo);
  border: 1px solid var(--borde);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.editorial-cat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem;
}

/* ── Acciones del editor (short / evergreen / alerta) ───────────────────── */
.acciones-editor {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
  align-items: center;
  margin: 1.5rem 0 .75rem;
}
.btn-grande { padding: 12px 22px; font-size: .95rem; }

/* Nota de tema sobre el form del editor */
.tema-nota { font-size: .85rem; color: var(--muted); margin-bottom: 1.5rem; }

/* Separador IA dentro de campo */
.campo-ia-sep { border-top: 1px solid var(--borde); padding-top: 1rem; margin-top: .5rem; }
.campo-ia-header { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; margin-bottom: .75rem; display: block; }

/* Fila bajo img-zona */
.img-info-row { display: flex; justify-content: space-between; align-items: center; min-height: 1.6rem; }
/* Botones de acción de imagen (JS pone display:flex) */
.img-acciones { gap: .5rem; align-items: center; }

/* Links de imágenes generadas */
.gen-links-col { display: flex; flex-direction: column; gap: .4rem; margin-top: .75rem; }
.gen-info-row  { display: flex; align-items: center; justify-content: space-between; font-size: .78rem; color: var(--muted); margin-bottom: .25rem; }
.gen-link-row  { display: flex; align-items: center; gap: .75rem; }
.gen-link      { font-size: .85rem; font-weight: 500; color: var(--muted); pointer-events: none; }
.gen-link.activo { color: var(--azul); pointer-events: auto; }

/* Aviso cambio de slug publicado */
.slug-aviso { display: none; margin-top: .4rem; padding: .5rem .75rem; background: #fffbeb; border: 1px solid #f59e0b; border-radius: 6px; font-size: .82rem; color: #92400e; }

/* ── Scraper page ───────────────────────────────────────────────────────── */
.sc-card { background: white; border: 1px solid var(--borde); border-radius: var(--radio); padding: 20px 24px; }
.sc-section-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 16px; }
.sc-toggle-row   { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.sc-toggle-info  { flex: 1; }
.sc-toggle-label { font-size: 18px; font-weight: 700; display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.sc-dot          { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.sc-dot-activo   { background: #22c55e; box-shadow: 0 0 0 3px #bbf7d0; }
.sc-dot-pausado  { background: #94a3b8; }
.sc-toggle-sub   { font-size: 13px; color: var(--muted); }
.sc-btn-toggle   { padding: 10px 24px; border-radius: var(--radio-pill); border: none; font-size: 14px; font-weight: 600; cursor: pointer; transition: background .15s; flex-shrink: 0; }
.sc-btn-pausar   { background: #fee2e2; color: #dc2626; }
.sc-btn-pausar:hover  { background: #fecaca; }
.sc-btn-reanudar { background: #dcfce7; color: #16a34a; }
.sc-btn-reanudar:hover { background: #bbf7d0; }
.sc-metricas-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.sc-metrica       { display: flex; flex-direction: column; align-items: center; padding: 14px 8px; background: #f8fafc; border-radius: 8px; }
.sc-metrica-num   { font-size: 28px; font-weight: 800; line-height: 1; margin-bottom: 4px; color: var(--texto); }
.sc-metrica-label { font-size: 11px; color: var(--muted); font-weight: 500; }
.sc-verde    { color: #16a34a; }
.sc-rojo     { color: #dc2626; }
.sc-amarillo { color: #d97706; }
.sc-fuente-fila { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--borde); }
.sc-fuente-fila:last-child { border-bottom: none; }
.sc-fuente-fila.inactiva .sc-fuente-nombre { opacity: .45; }
.sc-fuente-info   { flex: 1; min-width: 0; }
.sc-fuente-nombre { font-size: 14px; font-weight: 500; }
.sc-fuente-url    { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sc-fuente-tipo   { font-size: 11px; color: var(--muted); background: #f1f5f9; padding: 2px 8px; border-radius: 20px; flex-shrink: 0; }
.sc-fuente-acciones { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }
.sc-fuente-toggle { position: relative; width: 40px; height: 22px; flex-shrink: 0; }
.sc-fuente-toggle input { opacity: 0; width: 0; height: 0; }
.sc-slider { position: absolute; inset: 0; background: #cbd5e1; border-radius: 22px; cursor: pointer; transition: background .2s; }
.sc-slider::before { content: ''; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; background: white; border-radius: 50%; transition: transform .2s; }
.sc-fuente-toggle input:checked + .sc-slider { background: var(--azul); }
.sc-fuente-toggle input:checked + .sc-slider::before { transform: translateX(18px); }
.kw-lista { display: flex; flex-wrap: wrap; gap: 6px; min-height: 32px; }
.kw-chip  { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: var(--radio-pill); font-size: 13px; font-weight: 500; line-height: 1; }
.kw-chip-positiva { background: #dcfce7; color: #15803d; }
.kw-chip-negativa { background: #fee2e2; color: #b91c1c; }
.kw-chip button { background: none; border: none; cursor: pointer; font-size: 14px; line-height: 1; padding: 0; opacity: .6; color: inherit; }
.kw-chip button:hover { opacity: 1; }
.kw-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.kw-col-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 10px; }
.kw-add-row { display: flex; gap: 8px; margin-top: 10px; }
.sc-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.sc-card-header .sc-section-title { margin: 0; }
.prompt-textarea-ro { width: 100%; font-size: 13px; font-family: monospace; line-height: 1.5; resize: vertical; padding: 12px; border: 1px solid var(--borde); border-radius: 6px; box-sizing: border-box; background: #f8fafc; color: var(--muted); cursor: default; }
.prompt-textarea-ro.editable { background: var(--superficie); color: var(--texto); cursor: text; }

/* ── Alerta — layouts ───────────────────────────────────────────────────── */
.paso-main { padding: 0 24px 40px; }
.stepper-wrapper { padding: 0 24px 24px; }
.spinner-inline { display: inline-block; width: 14px; height: 14px; border: 2px solid var(--borde); border-top-color: var(--azul); border-radius: 50%; animation: spin .8s linear infinite; vertical-align: middle; margin-right: 6px; }
.spinner-lg { display: block; width: 36px; height: 36px; border: 3px solid var(--borde); border-top-color: var(--azul); border-radius: 50%; animation: spin .8s linear infinite; margin: 0 auto 1rem; }
.paso-acciones { border-top: 1px solid var(--borde); padding-top: 1.25rem; display: flex; gap: .75rem; flex-wrap: wrap; }
.paso-mensaje { padding: .6rem 1rem; border-radius: 6px; font-size: .85rem; margin-bottom: 1rem; }
.paso-mensaje.exito { background: #f0fdf4; color: var(--verde); }
.paso-mensaje.error { background: #fef2f2; color: var(--rojo); }
.fuente-extra-row { display: flex; gap: .5rem; }
.p3-section-label { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: .75rem; }
.btn-gen-alt { margin-bottom: 1rem; padding: .4rem .9rem; font-size: .8rem; border: 1px solid var(--borde); border-radius: var(--radio-pill); background: var(--superficie); cursor: pointer; }
.btn-gen-alt:hover { background: var(--fondo); }

/* Vista previa — Timeline */
.preview-tl-header { margin-bottom: 2rem; }
.preview-tl-titulo { font-size: 1.6rem; font-weight: 800; line-height: 1.25; margin-bottom: .5rem; color: var(--texto); }
.preview-tl-descripcion { font-size: 1rem; color: #4b5563; line-height: 1.6; }
.preview-tl-count  { font-size: .8rem; color: var(--muted); margin-top: .5rem; }
.preview-tl-lista  { position: relative; padding-left: 28px; border-left: 2px solid var(--borde); margin-left: 6px; }
.preview-tl-entry  { position: relative; margin-bottom: 2.5rem; }
.preview-tl-dot {
  position: absolute;
  left: -37px;
  top: 5px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #1d4ed8;
  border: 2px solid white;
  box-shadow: 0 0 0 2px #1d4ed8;
}
.preview-tl-fecha   { font-size: .75rem; color: var(--muted); margin-bottom: .3rem; font-weight: 500; text-transform: uppercase; letter-spacing: .04em; }
.preview-tl-titular { font-size: 1.05rem; font-weight: 700; line-height: 1.3; margin-bottom: .4rem; color: var(--texto); }
.preview-tl-desc    { font-size: .92rem; color: #374151; line-height: 1.6; }
.preview-tl-link    { display: inline-block; margin-top: .4rem; font-size: .82rem; color: #1d4ed8; text-decoration: none; font-weight: 500; }
.preview-tl-link:hover { text-decoration: underline; }

/* ── Scraper — clases adicionales ───────────────────────────────────────── */
.campo-inline { flex-direction: row; align-items: center; gap: 10px; }
.campo-inline label { margin: 0; }
.campo-inline input[type="checkbox"] { width: auto; flex-shrink: 0; }
.modal-error { color: var(--rojo); font-size: 13px; margin-top: 8px; min-height: 1rem; }
.kw-col-label-positive { color: var(--verde); }
.kw-col-label-negative { color: var(--rojo); }
.input-flex { flex: 1; }
.feedback-msg { margin-top: 8px; min-height: 18px; }
.text-sm-mb { font-size: 12px; margin-bottom: 8px; }
.input-number-lg { width: 80px; font-size: 18px; font-weight: 700; text-align: center; }
.dominios-lista { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.dominio-row { display: flex; align-items: center; justify-content: space-between; padding: 6px 10px; background: var(--fondo); border: 1px solid var(--borde); border-radius: 6px; font-size: 13px; }
.btn-eliminar-icon { background: none; border: none; cursor: pointer; color: var(--gris); font-size: 16px; line-height: 1; padding: 0 2px; }
.btn-eliminar-icon:hover { color: var(--rojo); }
.select-sm { padding: 4px 10px; border: 1px solid var(--borde); border-radius: 6px; font-size: .82rem; background: var(--fondo); color: var(--texto); cursor: pointer; width: auto; }
.kw-chip-sufijo { background: #f1f5f9; color: #334155; }
.text-empty-italic { font-size: 13px; color: var(--muted); font-style: italic; }
.mb-8  { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.prompt-header-actions { display: flex; gap: 8px; align-items: center; }
.opacity-half { opacity: .5; }



/* ── Contador de caracteres ─────────────────────────────────────────────── */
.contador-num { font-size: 11px; color: var(--muted); text-align: right; display: block; margin-top: 3px; }
.contador-num.warn { color: var(--amber); }
.contador-num.over { color: var(--rojo); font-weight: 600; }
