/* ============================================================================
   admin-canales · estilos (se añaden al CSS global de PeerTube)
   Usa las variables del tema para no desentonar: al desactivar el plugin
   desaparecen con él.
   ============================================================================ */

/* ------------------------------- panel ------------------------------------ */
.atril-panel {
  color: var(--mainForegroundColor, #0f0f0f);
  font-size: 14px;
}

.atril-panel-cab {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.atril-panel-cab h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
}

.atril-resumen {
  font-size: 12.5px;
  color: var(--greyForegroundColor, #606060);
  background: var(--submenuBackgroundColor, #f2f2f2);
  border-radius: 12px;
  padding: 4px 11px;
  white-space: nowrap;
}

.atril-hueco { flex: 1 1 auto; }

.atril-buscar {
  border: 1px solid var(--input-border-color, #ccc);
  border-radius: 18px;
  padding: 7px 14px;
  width: 280px;
  font: inherit;
  background: var(--mainBackgroundColor, #fff);
  color: inherit;
}

.atril-buscar:focus { outline: none; border-color: var(--mainColor, #cc0000); }

.atril-btn {
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  border: 1px solid var(--input-border-color, #e5e5e5);
  border-radius: 18px;
  padding: 6px 14px;
  background: var(--mainBackgroundColor, #fff);
  color: inherit;
  white-space: nowrap;
}

.atril-btn:hover { background: var(--submenuBackgroundColor, #f2f2f2); }
.atril-btn:disabled { opacity: .55; cursor: default; }

.atril-btn-primario {
  background: var(--mainColor, #cc0000);
  border-color: var(--mainColor, #cc0000);
  color: #fff;
}

.atril-btn-primario:hover { filter: brightness(.92); background: var(--mainColor, #cc0000); }

.atril-btn-peligro { color: #c00; border-color: rgba(204, 0, 0, .35); }
.atril-btn-peligro:hover { background: rgba(204, 0, 0, .08); }

.atril-cuerpo { overflow-x: auto; }

.atril-tabla {
  width: 100%;
  border-collapse: collapse;
}

.atril-tabla th,
.atril-tabla td {
  text-align: left;
  padding: 10px;
  border-bottom: 1px solid var(--input-border-color, #e5e5e5);
  vertical-align: middle;
}

.atril-tabla th {
  font-size: 12px;
  color: var(--greyForegroundColor, #606060);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .3px;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.atril-tabla th:hover { color: var(--mainForegroundColor, #0f0f0f); }
.atril-tabla tbody tr:hover { background: var(--submenuBackgroundColor, #f9f9f9); }

.atril-num { text-align: right; font-variant-numeric: tabular-nums; }
.atril-acc { text-align: right; white-space: nowrap; }
.atril-acc .atril-btn { margin-left: 6px; padding: 4px 11px; font-size: 12.5px; }

.atril-canal { display: flex; align-items: center; gap: 10px; min-width: 210px; }

.atril-canal img,
.atril-sin-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  flex: 0 0 34px;
}

.atril-sin-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--submenuBackgroundColor, #ddd);
  color: var(--greyForegroundColor, #666);
  font-weight: 700;
}

.atril-canal a { color: inherit; text-decoration: none; font-weight: 600; }
.atril-canal a:hover { text-decoration: underline; }
.atril-handle { color: var(--greyForegroundColor, #606060); font-size: 12px; }
.atril-dueno { font-size: 13px; }
.atril-dueno small { display: block; color: var(--greyForegroundColor, #606060); }

.atril-etq {
  display: inline-block;
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 10px;
  background: var(--submenuBackgroundColor, #eee);
}

.atril-etq-admin { background: rgba(204, 0, 0, .12); color: #b00020; }

.atril-vacio {
  color: var(--greyForegroundColor, #606060);
  padding: 28px;
  text-align: center;
}

/* ------------------------------- modal ------------------------------------ */
.atril-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .45);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1100;
  padding: 20px;
}

.atril-modal.ver { display: flex; }

.atril-modal-caja {
  background: var(--mainBackgroundColor, #fff);
  color: var(--mainForegroundColor, #0f0f0f);
  border-radius: 10px;
  width: 100%;
  max-width: 560px;
  padding: 22px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, .28);
}

.atril-modal-caja h2 { margin: 0 0 4px; font-size: 17px; }
.atril-modal-sub { margin: 0 0 12px; font-size: 12.5px; color: var(--greyForegroundColor, #606060); }
.atril-modal-caja label { display: block; font-size: 12px; color: var(--greyForegroundColor, #606060); margin: 12px 0 4px; }

.atril-modal-caja input[type="text"],
.atril-modal-caja textarea {
  width: 100%;
  margin-top: 4px;
  padding: 8px 11px;
  border: 1px solid var(--input-border-color, #ccc);
  border-radius: 5px;
  font: inherit;
  color: inherit;
  background: var(--mainBackgroundColor, #fff);
}

.atril-modal-caja textarea { min-height: 76px; resize: vertical; }
.atril-error { color: #b00020; font-size: 13px; min-height: 18px; margin-top: 8px; }
.atril-modal-pie { display: flex; gap: 10px; justify-content: flex-end; margin-top: 12px; }

/* ------------------- acceso «Canales» en la línea de vídeos ---------------- */
.atril-entrada-linea {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: 10px;
  padding: 6px 13px;
  border: 1px solid var(--input-border-color, #e5e5e5);
  border-radius: 18px;
  background: var(--mainBackgroundColor, #fff);
  color: inherit;
  font-size: 13px;
  text-decoration: none;
  white-space: nowrap;
}

.atril-entrada-linea:hover {
  background: var(--submenuBackgroundColor, #f2f2f2);
  text-decoration: none;
  color: inherit;
}

.atril-chip-icono { font-size: 13px; line-height: 1; opacity: .75; }

/* la entrada del menú lateral hereda todo del nativo; nada que forzar,
   salvo que la etiqueta no pueda desbordar y tapar otras entradas */
.atril-menu-canales { min-width: 0; }
.atril-menu-canales > a.menu-link { cursor: pointer; min-width: 0; overflow: hidden; }
.atril-menu-canales > a.menu-link > span {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ------------------------------- estrecho --------------------------------- */
@media (max-width: 900px) {
  .atril-panel-cab { gap: 8px; }
  .atril-panel-cab h1 { font-size: 19px; }
  .atril-buscar { width: 100%; order: 5; }
  .atril-resumen { order: 6; }
  .atril-cuerpo { overflow-x: visible; }
}

/* tabla convertida en tarjetas: nada de scroll horizontal en móvil */
@media (max-width: 720px) {
  .atril-tabla thead { display: none; }
  .atril-tabla,
  .atril-tabla tbody { display: block; width: 100%; }

  .atril-tabla tr {
    display: block;
    border: 1px solid var(--input-border-color, #e5e5e5);
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 10px;
  }

  .atril-tabla td {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    border: 0;
    padding: 3px 0;
    text-align: left;
  }

  .atril-tabla td::before {
    content: attr(data-label);
    color: var(--greyForegroundColor, #606060);
    font-size: 12px;
    flex: 0 0 auto;
  }

  .atril-tabla td:first-child { display: block; padding-bottom: 8px; }
  .atril-tabla td:first-child::before { content: none; }
  .atril-num { text-align: right; }
  .atril-acc { justify-content: flex-end; gap: 8px; padding-top: 8px; }
  .atril-acc::before { content: none; }
  .atril-canal { min-width: 0; }
}

