/*
 * 🎬 Videos: pedidos al estudio, sus reels terminados y la biblioteca de reutilización.
 * Usa los colores del tema del panel (styles.css). Todo va bajo .videos para no tocar el resto;
 * el detalle se abre en un diálogo y su caja también lleva la clase.
 */
.videos .vd-estado { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
/* Las pestañas técnicas (presentadores, PC del estudio y biblioteca) van aparte, a la derecha y más discretas (2026-10-31) */
.videos .tabs .vd-tab-aparte { margin-left: auto; }
.videos .tabs .vd-tab-tecnica { font-size: 13px; }
.videos .vd-estado > .banner { margin: 0; flex: 1; }
.videos .vd-pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 20px; border: 1px solid var(--line); background: var(--panel); font-size: 13px; flex-wrap: wrap; }
.videos .vd-pill small { color: var(--muted); }
.videos .vd-punto { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex-shrink: 0; }
.videos .vd-pill.ok .vd-punto { background: var(--ok); }
.videos .vd-pill.activo .vd-punto { background: var(--brand); }
.videos .vd-pill.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.videos .vd-pill.warn .vd-punto { background: var(--warn); }
.videos .vd-pill.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.videos .vd-pill.bad .vd-punto { background: var(--bad); }
.videos .vd-pill.bad small { color: inherit; opacity: .8; }

/* Videos hechos */
.videos .vd-lista { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; }
.videos .vd-trabajo { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.videos .vd-trabajo.en_curso { border-color: var(--brand); }
.videos .vd-trabajo.error { border-color: var(--bad-soft); }
.videos .vd-trabajo-cab { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.videos .vd-trabajo-cab b { word-break: break-word; }
.videos .vd-barra { height: 8px; border-radius: 6px; background: var(--line); overflow: hidden; margin-bottom: 4px; }
.videos .vd-barra span { display: block; height: 100%; background: var(--brand); border-radius: 6px; transition: width .4s; }
.videos .vd-error { color: var(--bad); font-size: 12px; white-space: pre-wrap; word-break: break-word; max-height: 90px; overflow: auto; }
.videos .vd-acciones { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; padding-top: 4px; }

/* Crear un video */
.videos .vd-form { max-width: 760px; }
.videos .vd-ficha-tema { margin: -4px 0 14px; padding: 10px 12px; border-radius: 10px; background: var(--bg); }
.videos .vd-costo { display: flex; flex-direction: column; gap: 2px; margin: 0 0 14px; padding: 10px 12px; border-radius: 10px; background: var(--brand-soft); }
.videos .vd-costo b { color: var(--brand); }
.videos .vd-no-aptos { margin: 0; padding-left: 18px; font-size: 13px; }
.videos .vd-no-aptos li { margin-bottom: 6px; }
.videos select optgroup { font-weight: 600; }

/* Biblioteca */
.videos .vd-fichas { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-bottom: 14px; }
.videos .vd-ficha { text-align: left; font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; cursor: pointer; }
.videos .vd-ficha:hover { border-color: var(--brand); }
.videos .vd-ficha.on { border-color: var(--brand); background: var(--brand-soft); }
.videos .vd-ficha b { display: block; font-size: 13px; }
.videos .vd-ficha small { color: var(--muted); font-size: 12px; }
.videos .vd-tabla td .badge { margin: 0 4px 4px 0; }
/* Nombre y ruta en una línea cada uno (el texto completo sale al pasar el mouse) */
.videos .vd-nombre b, .videos .vd-clave { display: block; max-width: 300px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.videos .vd-desc { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 460px; }
.videos .vd-nowrap { white-space: nowrap; }

/* Detalle del video */
.videos.vd-detalle h3 { display: flex; align-items: center; gap: 2px; margin-top: 22px; }
.videos .vd-detalle-cab { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.videos .vd-detalle-grid { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 20px; align-items: start; }
.videos .vd-detalle-grid h3 { margin-top: 0; }
.videos .vd-video { display: block; height: 70vh; max-height: 70vh; width: auto; max-width: 100%; aspect-ratio: 9 / 16; background: #000; border-radius: 12px; }
.videos .vd-archivos { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.videos .vd-archivos a, .videos .vd-archivos .sin-enlace { display: flex; flex-direction: column; padding: 7px 10px; border: 1px solid var(--line); border-radius: 9px; text-decoration: none; color: var(--ink); }
.videos .vd-archivos .sin-enlace { color: var(--muted); border-style: dashed; }
.videos .vd-archivos a:hover { border-color: var(--brand); background: var(--brand-soft); }
.videos .vd-archivos small { color: var(--muted); font-size: 11px; word-break: break-all; }
.videos .vd-portada { display: block; width: 120px; border-radius: 8px; border: 1px solid var(--line); margin-bottom: 10px; }
.videos .vd-avance { display: flex; flex-direction: column; gap: 4px; }
.videos .vd-avance .vd-barra { height: 12px; }
.videos .vd-log { max-height: 320px; }
.videos .vd-redes { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.videos .vd-red { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; min-width: 0; }
.videos .vd-red-parte { margin-top: 8px; }
.videos .vd-red-cab { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 4px; }
.videos .vd-red-texto { white-space: pre-wrap; word-break: break-word; font-size: 13px; background: var(--bg); border-radius: 8px; padding: 8px 10px; max-height: 180px; overflow: auto; }
.videos .vd-revision { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; margin-bottom: 12px; }
.videos .vd-reglas { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.videos .vd-reglas li { padding: 3px 0; }
.videos .vd-reglas li.ok b { color: var(--ok); }
.videos .vd-reglas li.bad { color: var(--bad); }
.videos .vd-hoja { display: block; max-width: 100%; border-radius: 10px; border: 1px solid var(--line); margin-bottom: 8px; }
.videos .vd-registro { margin-top: 18px; }
.videos .vd-registro summary { cursor: pointer; color: var(--muted); margin-bottom: 8px; }

/*
 * Publicar en Instagram y Facebook, programar y eliminar (2026-10-26). El diálogo de publicar lleva la clase
 * .videos.vd-aprobar y el de eliminar .videos.vd-eliminar, como el detalle.
 */
.videos .vd-filtros { margin-bottom: 12px; }
.videos .vd-insignias { display: flex; flex-wrap: wrap; gap: 4px; }
.videos .vd-deshacer { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 10px 14px; margin-bottom: 12px; border-radius: var(--radius); background: var(--ink); color: var(--bg); }
.videos .vd-deshacer .btn { background: transparent; color: inherit; border-color: currentColor; }
.videos .vd-aviso { color: var(--warn); }
.videos .vd-revisar { color: var(--warn); }
.videos .vd-candado { padding: 10px 12px; border-radius: 10px; background: var(--warn-soft); color: var(--warn); }
/* Detalle: «Publicar en redes» */
.videos .vd-pub-redes { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; margin-bottom: 8px; }
.videos .vd-pub-red { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.videos .vd-pub-red .vd-error { max-height: none; }
.videos .vd-pub-red-cab { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
/* Diálogo de publicar */
.videos.vd-aprobar { display: flex; flex-direction: column; gap: 12px; }
.videos.vd-aprobar .banner { margin: 0; }
.videos .vd-pub-resumen { display: flex; gap: 12px; align-items: center; }
.videos .vd-pub-portada { width: 72px; aspect-ratio: 9 / 16; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); flex: none; }
.videos .vd-elegir-redes { display: flex; flex-wrap: wrap; gap: 4px 18px; align-items: center; }
.videos .vd-elegir-redes > b { flex-basis: 100%; }
.videos.vd-aprobar .check { margin-bottom: 0; }
.videos .check.apagada { opacity: .6; font-weight: 400; }
.videos.vd-aprobar .vd-pub-red textarea { margin-top: 6px; }
.videos.vd-aprobar .vd-pub-red label.f { margin: 8px 0 0; }
.videos.vd-aprobar .vd-pub-red label.f:first-child { margin-top: 0; }
.videos.vd-aprobar .vd-pub-red.apagada { opacity: .5; }
.videos .vd-contador { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.videos .vd-contador.bad { color: var(--bad); font-weight: 600; }
.videos .vd-fecha { padding: 10px 12px; border-radius: 10px; background: var(--bg); }
.videos .vd-fecha .row { margin: 6px 0 4px; }
.videos .vd-fecha input { width: auto; min-width: 150px; }
/* Programados */
.videos .vd-programado { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }

/*
 * YouTube (2026-10-25): la ficha del detalle (.vd-pub-yt), el video relacionado, «Reconectar», el kit para subirlo a
 * mano y la píldora con enlace de la línea de estado. En el diálogo, los candados que dependen de lo marcado son cajas
 * que quedan vacías cuando no aplican: vacías no se ven ni dejan hueco.
 */
.videos.vd-aprobar > div:empty { display: none; }
.videos .vd-pill a { color: inherit; font-weight: 600; }
.videos .vd-yt-relacionado { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.videos .vd-yt-relacionado > .small { flex-basis: 100%; }
.videos .vd-yt-reconectar { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.videos .vd-yt-kit { border: 1px dashed var(--line); border-radius: 8px; padding: 6px 10px; }
.videos .vd-yt-kit summary { cursor: pointer; font-weight: 600; font-size: 13px; }
.videos .vd-yt-kit[open] summary { margin-bottom: 6px; }
.videos .vd-yt-kit p { margin: 0 0 6px; }
.videos .vd-yt-kit .vd-acciones { margin-top: 0; }
/* Eliminar (y Desconectar un PC, que usa la misma caja) */
.videos.vd-eliminar p { margin: 0 0 12px; }
.videos.vd-eliminar .check { font-weight: 400; align-items: flex-start; }

/*
 * El estudio en uno o varios PC y los presentadores (2026-10-26). El diálogo de conectar un PC lleva la clase
 * .videos.vd-conectar.
 */
.videos .vd-estado > .vd-viejo { flex-basis: 100%; }
.videos .vd-trabajo.en_pc { border-color: var(--brand); }
.videos .chip:disabled { opacity: .5; cursor: not-allowed; }
.videos .vd-enlace { font: inherit; background: none; border: 0; padding: 0; color: var(--brand); text-decoration: underline; cursor: pointer; }
/* Crear un video: presentador y motor */
.videos .vd-campo { margin-bottom: 14px; }
.videos .vd-campo > span { display: block; font-weight: 600; margin-bottom: 6px; }
.videos .vd-campo > .vd-aviso { margin-top: 6px; }
.videos .vd-pres-opciones { display: flex; flex-wrap: wrap; gap: 8px; }
.videos .vd-pres-opcion { display: flex; align-items: center; gap: 10px; min-width: 0; text-align: left; font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; cursor: pointer; }
.videos .vd-pres-opcion:hover:not(:disabled) { border-color: var(--brand); }
.videos .vd-pres-opcion.on { border-color: var(--brand); background: var(--brand-soft); }
.videos .vd-pres-opcion:disabled { opacity: .55; cursor: not-allowed; }
.videos .vd-pres-opcion b { display: block; font-size: 13px; }
.videos .vd-pres-opcion small { display: block; color: var(--muted); font-size: 12px; }
.videos .vd-pres-caras { display: flex; flex: none; }
.videos .vd-pres-caras img, .videos .vd-pres-sin { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; border: 2px solid var(--panel); background: var(--line); display: grid; place-items: center; font-size: 18px; }
.videos .vd-pres-caras > * + * { margin-left: -10px; }
.videos .vd-motores { align-items: center; margin-bottom: 0; }
/* Presentadores */
.videos .vd-aviso-ia { padding: 10px 12px; border-radius: 10px; background: var(--brand-soft); color: var(--brand); margin: 0 0 12px; font-size: 13px; }
.videos .vd-pres-pedido { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border-radius: 10px; background: var(--bg); margin-bottom: 12px; }
.videos .vd-pres-preparar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.videos .vd-presentadores .banner { margin: 12px 0 0; }
.videos .vd-presentadores-lista { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.videos .vd-presentador { display: flex; flex-direction: column; gap: 8px; min-width: 0; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.videos .vd-presentador.revisar { border-color: var(--warn); }
.videos .vd-pres-revision { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.videos .vd-pres-revision figure { margin: 0; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.videos .vd-pres-foto, .videos .vd-pres-cierre, .videos .vd-pres-vacio { display: block; width: 100%; aspect-ratio: 9 / 16; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); background: #000; }
.videos .vd-pres-vacio { display: grid; place-items: center; background: var(--bg); color: var(--muted); font-size: 12px; }
.videos .vd-pres-listo { display: flex; align-items: center; gap: 12px; }
.videos .vd-pres-mini { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; border: 1px solid var(--line); flex: none; }
/*
 * 💡 Ideas (2026-10-31): la cabecera con la cobertura y «Proponer», las tarjetas de cada idea (el gancho destacado y la
 * estructura en lista) y, plegadas, las decididas y las tendencias con sus fuentes.
 */
.videos .vd-ideas-cab .vd-cobertura { margin: 0 0 10px; }
.videos .vd-ideas-cab .banner { margin: 10px 0 0; }
.videos .vd-proponer { gap: 6px 12px; flex-wrap: wrap; }
.videos .vd-ideas-pres { margin-top: 12px; }
.videos .vd-ideas-pres summary { font-size: 13px; }
.videos .vd-ideas-pres .vd-pres-opciones { margin-bottom: 8px; }
.videos .vd-ideas { margin-bottom: 14px; }
.videos .vd-idea { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.videos .vd-idea.hecha, .videos .vd-idea.descartada { gap: 4px; }
.videos .vd-idea.descartada { opacity: .7; }
.videos .vd-idea-gancho { padding: 8px 10px; border-radius: 8px; background: var(--brand-soft); color: var(--brand); font-weight: 600; word-break: break-word; }
.videos .vd-idea-gancho small { display: block; font-weight: 400; opacity: .8; }
.videos .vd-idea-estructura { margin: 0; padding-left: 20px; }
.videos .vd-idea-estructura li { margin-bottom: 2px; }
.videos .vd-ideas-decididas, .videos .vd-tendencias { margin-bottom: 14px; }
.videos .vd-tendencias-lista { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; margin-bottom: 12px; }
.videos .vd-tendencia { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.videos .vd-ejemplos { margin: 0; padding-left: 18px; }
.videos .vd-fuentes ul { margin: 4px 0 0; padding-left: 18px; }
.videos .vd-fuentes a { word-break: break-word; }
.videos .vd-enfoque { flex-basis: 100%; }
/* PC del estudio */
.videos .vd-equipos-cab > .small { margin-bottom: 6px; }
.videos .vd-equipos-cab .banner { margin: 8px 0; }
.videos .vd-conectar-fila { margin-top: 12px; }
.videos .vd-equipo { display: flex; flex-direction: column; gap: 6px; min-width: 0; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.videos .vd-equipo.trabajando { border-color: var(--brand); }
.videos .vd-equipo.pausado, .videos .vd-equipo.desactualizado { border-color: var(--warn); }
.videos .vd-equipo.apagado, .videos .vd-equipo.sin_emparejar { border-style: dashed; }
.videos .vd-equipo-estado { font-weight: 600; word-break: break-word; }
.videos .vd-equipo .small { word-break: break-word; }
/* Conectar un PC (2026-10-25): pasos y «⬇️ Descargar el instalador»; ya no hay comando ni nada que copiar */
.videos.vd-conectar { display: flex; flex-direction: column; gap: 12px; }
.videos.vd-conectar p { margin: 0; }
.videos.vd-conectar .banner { margin: 0; }
.videos .vd-pasos { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 14px; }
.videos .vd-pasos li > b { display: block; margin-bottom: 4px; }
.videos .vd-pasos li > .btn, .videos .vd-pasos .row { margin-top: 6px; }
.videos .vd-pasos li > .btn + .small { margin-top: 6px; }
.videos .vd-pasos li .small b { font-family: ui-monospace, Menlo, Consolas, monospace; letter-spacing: 1px; color: var(--ink); }

@media (max-width: 720px) {
  .videos .vd-detalle-grid { grid-template-columns: 1fr; }
  .videos .vd-video { width: 100%; height: auto; }
  .videos .vd-lista { grid-template-columns: 1fr; }
  .videos .vd-pub-redes { grid-template-columns: 1fr; }
  .videos .vd-fecha input { flex: 1; min-width: 0; }
  .videos.vd-aprobar .vd-acciones .btn { flex: 1 1 100%; justify-content: center; }
  .videos .vd-yt-kit .vd-acciones .btn { flex: 1 1 100%; justify-content: center; }
  .videos .vd-pres-opcion { flex: 1 1 100%; }
  .videos .vd-presentadores-lista { grid-template-columns: 1fr; }
  .videos .tabs .vd-tab-aparte { margin-left: 0; }
  .videos .vd-tendencias-lista { grid-template-columns: 1fr; }
  .videos.vd-conectar .vd-acciones .btn, .videos .vd-pasos li > .btn { flex: 1 1 100%; justify-content: center; width: 100%; }
}
